ia64/xen-unstable

changeset 14857:456c611ada02

Added documentation and C bindings for VBD. and VIF.runtime_properties.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Thu Apr 12 22:49:02 2007 +0100 (2007-04-12)
parents 0c00c6a48d52
children 249de074617f
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	Fri Apr 13 17:17:21 2007 +0100
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Thu Apr 12 22:49:02 2007 +0100
     1.3 @@ -7742,6 +7742,7 @@ Quals & Field & Type & Description \\
     1.4  $\mathit{RO}_\mathit{run}$ &  {\tt currently\_attached} & bool & is the device currently attached (erased on reboot) \\
     1.5  $\mathit{RO}_\mathit{run}$ &  {\tt status\_code} & int & error/success code associated with last attach-operation (erased on reboot) \\
     1.6  $\mathit{RO}_\mathit{run}$ &  {\tt status\_detail} & string & error/success information associated with last attach-operation status (erased on reboot) \\
     1.7 +$\mathit{RO}_\mathit{run}$ &  {\tt runtime\_properties} & (string $\rightarrow$ string) Map & Device runtime properties \\
     1.8  $\mathit{RW}$ &  {\tt qos/algorithm\_type} & string & QoS algorithm to use \\
     1.9  $\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & parameters for chosen QoS algorithm \\
    1.10  $\mathit{RO}_\mathit{run}$ &  {\tt qos/supported\_algorithms} & string Set & supported QoS algorithms for this VIF \\
    1.11 @@ -8225,6 +8226,38 @@ value of the field
    1.12  \vspace{0.3cm}
    1.13  \vspace{0.3cm}
    1.14  \vspace{0.3cm}
    1.15 +\subsubsection{RPC name:~get\_runtime\_properties}
    1.16 +
    1.17 +{\bf Overview:} 
    1.18 +Get the runtime\_properties field of the given VIF.
    1.19 +
    1.20 + \noindent {\bf Signature:} 
    1.21 +\begin{verbatim} ((string -> string) Map) get_runtime_properties (session_id s, VIF ref self)\end{verbatim}
    1.22 +
    1.23 +
    1.24 +\noindent{\bf Arguments:}
    1.25 +
    1.26 + 
    1.27 +\vspace{0.3cm}
    1.28 +\begin{tabular}{|c|c|p{7cm}|}
    1.29 + \hline
    1.30 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.31 +{\tt VIF ref } & self & reference to the object \\ \hline 
    1.32 +
    1.33 +\end{tabular}
    1.34 +
    1.35 +\vspace{0.3cm}
    1.36 +
    1.37 + \noindent {\bf Return Type:} 
    1.38 +{\tt 
    1.39 +(string $\rightarrow$ string) Map
    1.40 +}
    1.41 +
    1.42 +
    1.43 +value of the field
    1.44 +\vspace{0.3cm}
    1.45 +\vspace{0.3cm}
    1.46 +\vspace{0.3cm}
    1.47  \subsubsection{RPC name:~get\_qos\_algorithm\_type}
    1.48  
    1.49  {\bf Overview:} 
    1.50 @@ -11108,6 +11141,7 @@ Quals & Field & Type & Description \\
    1.51  $\mathit{RO}_\mathit{run}$ &  {\tt currently\_attached} & bool & is the device currently attached (erased on reboot) \\
    1.52  $\mathit{RO}_\mathit{run}$ &  {\tt status\_code} & int & error/success code associated with last attach-operation (erased on reboot) \\
    1.53  $\mathit{RO}_\mathit{run}$ &  {\tt status\_detail} & string & error/success information associated with last attach-operation status (erased on reboot) \\
    1.54 +$\mathit{RO}_\mathit{run}$ &  {\tt runtime\_properties} & (string $\rightarrow$ string) Map & Device runtime properties \\
    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 & parameters for chosen QoS algorithm \\
    1.57  $\mathit{RO}_\mathit{run}$ &  {\tt qos/supported\_algorithms} & string Set & supported QoS algorithms for this VBD \\
    1.58 @@ -11692,6 +11726,38 @@ value of the field
    1.59  \vspace{0.3cm}
    1.60  \vspace{0.3cm}
    1.61  \vspace{0.3cm}
    1.62 +\subsubsection{RPC name:~get\_runtime\_properties}
    1.63 +
    1.64 +{\bf Overview:} 
    1.65 +Get the runtime\_properties field of the given VBD.
    1.66 +
    1.67 + \noindent {\bf Signature:} 
    1.68 +\begin{verbatim} ((string -> string) Map) get_runtime_properties (session_id s, VBD ref self)\end{verbatim}
    1.69 +
    1.70 +
    1.71 +\noindent{\bf Arguments:}
    1.72 +
    1.73 + 
    1.74 +\vspace{0.3cm}
    1.75 +\begin{tabular}{|c|c|p{7cm}|}
    1.76 + \hline
    1.77 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.78 +{\tt VBD ref } & self & reference to the object \\ \hline 
    1.79 +
    1.80 +\end{tabular}
    1.81 +
    1.82 +\vspace{0.3cm}
    1.83 +
    1.84 + \noindent {\bf Return Type:} 
    1.85 +{\tt 
    1.86 +(string $\rightarrow$ string) Map
    1.87 +}
    1.88 +
    1.89 +
    1.90 +value of the field
    1.91 +\vspace{0.3cm}
    1.92 +\vspace{0.3cm}
    1.93 +\vspace{0.3cm}
    1.94  \subsubsection{RPC name:~get\_qos\_algorithm\_type}
    1.95  
    1.96  {\bf Overview:} 
     2.1 --- a/tools/libxen/include/xen_vbd.h	Fri Apr 13 17:17:21 2007 +0100
     2.2 +++ b/tools/libxen/include/xen_vbd.h	Thu Apr 12 22:49:02 2007 +0100
     2.3 @@ -78,6 +78,7 @@ typedef struct xen_vbd_record
     2.4      bool currently_attached;
     2.5      int64_t status_code;
     2.6      char *status_detail;
     2.7 +    xen_string_string_map *runtime_properties;
     2.8      char *qos_algorithm_type;
     2.9      xen_string_string_map *qos_algorithm_params;
    2.10      struct xen_string_set *qos_supported_algorithms;
    2.11 @@ -262,6 +263,13 @@ xen_vbd_get_status_detail(xen_session *s
    2.12  
    2.13  
    2.14  /**
    2.15 + * Get the runtime_properties field of the given VBD.
    2.16 + */
    2.17 +extern bool
    2.18 +xen_vbd_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
    2.19 +
    2.20 +
    2.21 +/**
    2.22   * Get the qos/algorithm_type field of the given VBD.
    2.23   */
    2.24  extern bool
     3.1 --- a/tools/libxen/include/xen_vif.h	Fri Apr 13 17:17:21 2007 +0100
     3.2 +++ b/tools/libxen/include/xen_vif.h	Thu Apr 12 22:49:02 2007 +0100
     3.3 @@ -75,6 +75,7 @@ typedef struct xen_vif_record
     3.4      bool currently_attached;
     3.5      int64_t status_code;
     3.6      char *status_detail;
     3.7 +    xen_string_string_map *runtime_properties;
     3.8      char *qos_algorithm_type;
     3.9      xen_string_string_map *qos_algorithm_params;
    3.10      struct xen_string_set *qos_supported_algorithms;
    3.11 @@ -252,6 +253,13 @@ xen_vif_get_status_detail(xen_session *s
    3.12  
    3.13  
    3.14  /**
    3.15 + * Get the runtime_properties field of the given VIF.
    3.16 + */
    3.17 +extern bool
    3.18 +xen_vif_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vif vif);
    3.19 +
    3.20 +
    3.21 +/**
    3.22   * Get the qos/algorithm_type field of the given VIF.
    3.23   */
    3.24  extern bool
    3.25 @@ -333,7 +341,7 @@ xen_vif_remove_from_qos_algorithm_params
    3.26  
    3.27  /**
    3.28   * Hotplug the specified VIF, dynamically attaching it to the running
    3.29 - * VM
    3.30 + * VM.
    3.31   */
    3.32  extern bool
    3.33  xen_vif_plug(xen_session *session, xen_vif self);
    3.34 @@ -341,7 +349,7 @@ xen_vif_plug(xen_session *session, xen_v
    3.35  
    3.36  /**
    3.37   * Hot-unplug the specified VIF, dynamically unattaching it from the
    3.38 - * running VM
    3.39 + * running VM.
    3.40   */
    3.41  extern bool
    3.42  xen_vif_unplug(xen_session *session, xen_vif self);
     4.1 --- a/tools/libxen/src/xen_vbd.c	Fri Apr 13 17:17:21 2007 +0100
     4.2 +++ b/tools/libxen/src/xen_vbd.c	Thu Apr 12 22:49:02 2007 +0100
     4.3 @@ -72,6 +72,9 @@ static const struct_member xen_vbd_recor
     4.4          { .key = "status_detail",
     4.5            .type = &abstract_type_string,
     4.6            .offset = offsetof(xen_vbd_record, status_detail) },
     4.7 +        { .key = "runtime_properties",
     4.8 +          .type = &abstract_type_string_string_map,
     4.9 +          .offset = offsetof(xen_vbd_record, runtime_properties) },
    4.10          { .key = "qos_algorithm_type",
    4.11            .type = &abstract_type_string,
    4.12            .offset = offsetof(xen_vbd_record, qos_algorithm_type) },
    4.13 @@ -109,6 +112,7 @@ xen_vbd_record_free(xen_vbd_record *reco
    4.14      xen_vdi_record_opt_free(record->vdi);
    4.15      free(record->device);
    4.16      free(record->status_detail);
    4.17 +    xen_string_string_map_free(record->runtime_properties);
    4.18      free(record->qos_algorithm_type);
    4.19      xen_string_string_map_free(record->qos_algorithm_params);
    4.20      xen_string_set_free(record->qos_supported_algorithms);
    4.21 @@ -335,6 +339,23 @@ xen_vbd_get_status_detail(xen_session *s
    4.22  
    4.23  
    4.24  bool
    4.25 +xen_vbd_get_runtime_properties(xen_session *session, xen_string_string_map **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_string_map;
    4.34 +
    4.35 +    *result = NULL;
    4.36 +    XEN_CALL_("VBD.get_runtime_properties");
    4.37 +    return session->ok;
    4.38 +}
    4.39 +
    4.40 +
    4.41 +bool
    4.42  xen_vbd_get_qos_algorithm_type(xen_session *session, char **result, xen_vbd vbd)
    4.43  {
    4.44      abstract_value param_values[] =
     5.1 --- a/tools/libxen/src/xen_vif.c	Fri Apr 13 17:17:21 2007 +0100
     5.2 +++ b/tools/libxen/src/xen_vif.c	Thu Apr 12 22:49:02 2007 +0100
     5.3 @@ -67,6 +67,9 @@ static const struct_member xen_vif_recor
     5.4          { .key = "status_detail",
     5.5            .type = &abstract_type_string,
     5.6            .offset = offsetof(xen_vif_record, status_detail) },
     5.7 +        { .key = "runtime_properties",
     5.8 +          .type = &abstract_type_string_string_map,
     5.9 +          .offset = offsetof(xen_vif_record, runtime_properties) },
    5.10          { .key = "qos_algorithm_type",
    5.11            .type = &abstract_type_string,
    5.12            .offset = offsetof(xen_vif_record, qos_algorithm_type) },
    5.13 @@ -105,6 +108,7 @@ xen_vif_record_free(xen_vif_record *reco
    5.14      xen_vm_record_opt_free(record->vm);
    5.15      free(record->mac);
    5.16      free(record->status_detail);
    5.17 +    xen_string_string_map_free(record->runtime_properties);
    5.18      free(record->qos_algorithm_type);
    5.19      xen_string_string_map_free(record->qos_algorithm_params);
    5.20      xen_string_set_free(record->qos_supported_algorithms);
    5.21 @@ -318,6 +322,23 @@ xen_vif_get_status_detail(xen_session *s
    5.22  
    5.23  
    5.24  bool
    5.25 +xen_vif_get_runtime_properties(xen_session *session, xen_string_string_map **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_string_map;
    5.34 +
    5.35 +    *result = NULL;
    5.36 +    XEN_CALL_("VIF.get_runtime_properties");
    5.37 +    return session->ok;
    5.38 +}
    5.39 +
    5.40 +
    5.41 +bool
    5.42  xen_vif_get_qos_algorithm_type(xen_session *session, char **result, xen_vif vif)
    5.43  {
    5.44      abstract_value param_values[] =