direct-io.hg

changeset 14106:fd7f23e44b11

Added VBD. and VIF.qos_supported_algorithms fields, with C bindings, Xend
implementation to follow.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Wed Feb 21 23:03:00 2007 +0000 (2007-02-21)
parents c051ed67258a
children f3aa6e34aeb1
files docs/xen-api/xenapi-datamodel.tex tools/libxen/include/xen_vbd.h tools/libxen/include/xen_vif.h tools/libxen/src/xen_vbd.c tools/libxen/src/xen_vif.c
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Sat Feb 24 15:30:19 2007 +0000
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Wed Feb 21 23:03:00 2007 +0000
     1.3 @@ -6680,7 +6680,8 @@ Quals & Field & Type & Description \\
     1.4  $\mathit{RW}$ &  {\tt MAC} & string & ethernet MAC address of virtual interface, as exposed to guest \\
     1.5  $\mathit{RW}$ &  {\tt MTU} & int & MTU in octets \\
     1.6  $\mathit{RW}$ &  {\tt qos/algorithm\_type} & string & QoS algorithm to use \\
     1.7 -$\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & Paramters for chosen QoS algorithm \\
     1.8 +$\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & parameters for chosen QoS algorithm \\
     1.9 +$\mathit{RO}_\mathit{run}$ &  {\tt qos/supported\_algorithms} & string Set & supported QoS algorithms for this VIF \\
    1.10  $\mathit{RO}_\mathit{run}$ &  {\tt metrics} & VIF\_metrics ref & metrics associated with this VIF. \\
    1.11  \hline
    1.12  \end{longtable}
    1.13 @@ -7184,6 +7185,38 @@ void
    1.14  \vspace{0.3cm}
    1.15  \vspace{0.3cm}
    1.16  \vspace{0.3cm}
    1.17 +\subsubsection{RPC name:~get\_qos\_supported\_algorithms}
    1.18 +
    1.19 +{\bf Overview:} 
    1.20 +Get the qos/supported\_algorithms field of the given VIF.
    1.21 +
    1.22 + \noindent {\bf Signature:} 
    1.23 +\begin{verbatim} (string Set) get_qos_supported_algorithms (session_id s, VIF ref self)\end{verbatim}
    1.24 +
    1.25 +
    1.26 +\noindent{\bf Arguments:}
    1.27 +
    1.28 + 
    1.29 +\vspace{0.3cm}
    1.30 +\begin{tabular}{|c|c|p{7cm}|}
    1.31 + \hline
    1.32 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.33 +{\tt VIF ref } & self & reference to the object \\ \hline 
    1.34 +
    1.35 +\end{tabular}
    1.36 +
    1.37 +\vspace{0.3cm}
    1.38 +
    1.39 + \noindent {\bf Return Type:} 
    1.40 +{\tt 
    1.41 +string Set
    1.42 +}
    1.43 +
    1.44 +
    1.45 +value of the field
    1.46 +\vspace{0.3cm}
    1.47 +\vspace{0.3cm}
    1.48 +\vspace{0.3cm}
    1.49  \subsubsection{RPC name:~get\_metrics}
    1.50  
    1.51  {\bf Overview:} 
    1.52 @@ -9787,8 +9820,9 @@ Quals & Field & Type & Description \\
    1.53  $\mathit{RW}$ &  {\tt mode} & vbd\_mode & the mode the VBD should be mounted with \\
    1.54  $\mathit{RW}$ &  {\tt type} & vbd\_type & how the VBD will appear to the guest (e.g. disk or CD) \\
    1.55  $\mathit{RW}$ &  {\tt qos/algorithm\_type} & string & QoS algorithm to use \\
    1.56 -$\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & Paramters for chosen QoS algorithm \\
    1.57 -$\mathit{RO}_\mathit{run}$ &  {\tt metrics} & VBD\_metrics ref & metrics associated with this VBD. \\
    1.58 +$\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & parameters for chosen QoS algorithm \\
    1.59 +$\mathit{RO}_\mathit{run}$ &  {\tt qos/supported\_algorithms} & string Set & supported QoS algorithms for this VBD \\
    1.60 +$\mathit{RO}_\mathit{run}$ &  {\tt metrics} & VBD\_metrics ref & metrics associated with this VBD \\
    1.61  \hline
    1.62  \end{longtable}
    1.63  \subsection{Additional RPCs associated with class: VBD}
    1.64 @@ -10392,6 +10426,38 @@ void
    1.65  \vspace{0.3cm}
    1.66  \vspace{0.3cm}
    1.67  \vspace{0.3cm}
    1.68 +\subsubsection{RPC name:~get\_qos\_supported\_algorithms}
    1.69 +
    1.70 +{\bf Overview:} 
    1.71 +Get the qos/supported\_algorithms field of the given VBD.
    1.72 +
    1.73 + \noindent {\bf Signature:} 
    1.74 +\begin{verbatim} (string Set) get_qos_supported_algorithms (session_id s, VBD ref self)\end{verbatim}
    1.75 +
    1.76 +
    1.77 +\noindent{\bf Arguments:}
    1.78 +
    1.79 + 
    1.80 +\vspace{0.3cm}
    1.81 +\begin{tabular}{|c|c|p{7cm}|}
    1.82 + \hline
    1.83 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.84 +{\tt VBD ref } & self & reference to the object \\ \hline 
    1.85 +
    1.86 +\end{tabular}
    1.87 +
    1.88 +\vspace{0.3cm}
    1.89 +
    1.90 + \noindent {\bf Return Type:} 
    1.91 +{\tt 
    1.92 +string Set
    1.93 +}
    1.94 +
    1.95 +
    1.96 +value of the field
    1.97 +\vspace{0.3cm}
    1.98 +\vspace{0.3cm}
    1.99 +\vspace{0.3cm}
   1.100  \subsubsection{RPC name:~get\_metrics}
   1.101  
   1.102  {\bf Overview:} 
     2.1 --- a/tools/libxen/include/xen_vbd.h	Sat Feb 24 15:30:19 2007 +0000
     2.2 +++ b/tools/libxen/include/xen_vbd.h	Wed Feb 21 23:03:00 2007 +0000
     2.3 @@ -20,6 +20,7 @@
     2.4  #define XEN_VBD_H
     2.5  
     2.6  #include "xen_common.h"
     2.7 +#include "xen_string_set.h"
     2.8  #include "xen_string_string_map.h"
     2.9  #include "xen_vbd_decl.h"
    2.10  #include "xen_vbd_metrics_decl.h"
    2.11 @@ -77,6 +78,7 @@ typedef struct xen_vbd_record
    2.12      enum xen_vbd_type type;
    2.13      char *qos_algorithm_type;
    2.14      xen_string_string_map *qos_algorithm_params;
    2.15 +    struct xen_string_set *qos_supported_algorithms;
    2.16      struct xen_vbd_metrics_record_opt *metrics;
    2.17  } xen_vbd_record;
    2.18  
    2.19 @@ -251,6 +253,13 @@ xen_vbd_get_qos_algorithm_params(xen_ses
    2.20  
    2.21  
    2.22  /**
    2.23 + * Get the qos/supported_algorithms field of the given VBD.
    2.24 + */
    2.25 +extern bool
    2.26 +xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd);
    2.27 +
    2.28 +
    2.29 +/**
    2.30   * Get the metrics field of the given VBD.
    2.31   */
    2.32  extern bool
     3.1 --- a/tools/libxen/include/xen_vif.h	Sat Feb 24 15:30:19 2007 +0000
     3.2 +++ b/tools/libxen/include/xen_vif.h	Wed Feb 21 23:03:00 2007 +0000
     3.3 @@ -21,6 +21,7 @@
     3.4  
     3.5  #include "xen_common.h"
     3.6  #include "xen_network_decl.h"
     3.7 +#include "xen_string_set.h"
     3.8  #include "xen_string_string_map.h"
     3.9  #include "xen_vif_decl.h"
    3.10  #include "xen_vif_metrics_decl.h"
    3.11 @@ -73,6 +74,7 @@ typedef struct xen_vif_record
    3.12      int64_t mtu;
    3.13      char *qos_algorithm_type;
    3.14      xen_string_string_map *qos_algorithm_params;
    3.15 +    struct xen_string_set *qos_supported_algorithms;
    3.16      struct xen_vif_metrics_record_opt *metrics;
    3.17  } xen_vif_record;
    3.18  
    3.19 @@ -240,6 +242,13 @@ xen_vif_get_qos_algorithm_params(xen_ses
    3.20  
    3.21  
    3.22  /**
    3.23 + * Get the qos/supported_algorithms field of the given VIF.
    3.24 + */
    3.25 +extern bool
    3.26 +xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif);
    3.27 +
    3.28 +
    3.29 +/**
    3.30   * Get the metrics field of the given VIF.
    3.31   */
    3.32  extern bool
     4.1 --- a/tools/libxen/src/xen_vbd.c	Sat Feb 24 15:30:19 2007 +0000
     4.2 +++ b/tools/libxen/src/xen_vbd.c	Wed Feb 21 23:03:00 2007 +0000
     4.3 @@ -72,6 +72,9 @@ static const struct_member xen_vbd_recor
     4.4          { .key = "qos_algorithm_params",
     4.5            .type = &abstract_type_string_string_map,
     4.6            .offset = offsetof(xen_vbd_record, qos_algorithm_params) },
     4.7 +        { .key = "qos_supported_algorithms",
     4.8 +          .type = &abstract_type_string_set,
     4.9 +          .offset = offsetof(xen_vbd_record, qos_supported_algorithms) },
    4.10          { .key = "metrics",
    4.11            .type = &abstract_type_ref,
    4.12            .offset = offsetof(xen_vbd_record, metrics) }
    4.13 @@ -101,6 +104,7 @@ xen_vbd_record_free(xen_vbd_record *reco
    4.14      free(record->device);
    4.15      free(record->qos_algorithm_type);
    4.16      xen_string_string_map_free(record->qos_algorithm_params);
    4.17 +    xen_string_set_free(record->qos_supported_algorithms);
    4.18      xen_vbd_metrics_record_opt_free(record->metrics);
    4.19      free(record);
    4.20  }
    4.21 @@ -309,6 +313,23 @@ xen_vbd_get_qos_algorithm_params(xen_ses
    4.22  
    4.23  
    4.24  bool
    4.25 +xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd)
    4.26 +{
    4.27 +    abstract_value param_values[] =
    4.28 +        {
    4.29 +            { .type = &abstract_type_string,
    4.30 +              .u.string_val = vbd }
    4.31 +        };
    4.32 +
    4.33 +    abstract_type result_type = abstract_type_string_set;
    4.34 +
    4.35 +    *result = NULL;
    4.36 +    XEN_CALL_("VBD.get_qos_supported_algorithms");
    4.37 +    return session->ok;
    4.38 +}
    4.39 +
    4.40 +
    4.41 +bool
    4.42  xen_vbd_get_metrics(xen_session *session, xen_vbd_metrics *result, xen_vbd vbd)
    4.43  {
    4.44      abstract_value param_values[] =
     5.1 --- a/tools/libxen/src/xen_vif.c	Sat Feb 24 15:30:19 2007 +0000
     5.2 +++ b/tools/libxen/src/xen_vif.c	Wed Feb 21 23:03:00 2007 +0000
     5.3 @@ -64,6 +64,9 @@ static const struct_member xen_vif_recor
     5.4          { .key = "qos_algorithm_params",
     5.5            .type = &abstract_type_string_string_map,
     5.6            .offset = offsetof(xen_vif_record, qos_algorithm_params) },
     5.7 +        { .key = "qos_supported_algorithms",
     5.8 +          .type = &abstract_type_string_set,
     5.9 +          .offset = offsetof(xen_vif_record, qos_supported_algorithms) },
    5.10          { .key = "metrics",
    5.11            .type = &abstract_type_ref,
    5.12            .offset = offsetof(xen_vif_record, metrics) }
    5.13 @@ -94,6 +97,7 @@ xen_vif_record_free(xen_vif_record *reco
    5.14      free(record->mac);
    5.15      free(record->qos_algorithm_type);
    5.16      xen_string_string_map_free(record->qos_algorithm_params);
    5.17 +    xen_string_set_free(record->qos_supported_algorithms);
    5.18      xen_vif_metrics_record_opt_free(record->metrics);
    5.19      free(record);
    5.20  }
    5.21 @@ -289,6 +293,23 @@ xen_vif_get_qos_algorithm_params(xen_ses
    5.22  
    5.23  
    5.24  bool
    5.25 +xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif)
    5.26 +{
    5.27 +    abstract_value param_values[] =
    5.28 +        {
    5.29 +            { .type = &abstract_type_string,
    5.30 +              .u.string_val = vif }
    5.31 +        };
    5.32 +
    5.33 +    abstract_type result_type = abstract_type_string_set;
    5.34 +
    5.35 +    *result = NULL;
    5.36 +    XEN_CALL_("VIF.get_qos_supported_algorithms");
    5.37 +    return session->ok;
    5.38 +}
    5.39 +
    5.40 +
    5.41 +bool
    5.42  xen_vif_get_metrics(xen_session *session, xen_vif_metrics *result, xen_vif vif)
    5.43  {
    5.44      abstract_value param_values[] =