[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Added documentation and C bindings for VBD/VIF.status_detail, status_code, and



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1172443649 0
# Node ID cfd23ac1b32a2a7538eeb68f5b86ebbe059866ff
# Parent  532a25342a3090af9a227194951348a040ece27b
Added documentation and C bindings for VBD/VIF.status_detail, status_code, and
currently_attached fields.  Not yet implemented.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 docs/xen-api/xenapi-datamodel.tex |  198 ++++++++++++++++++++++++++++++++++++++
 tools/libxen/include/xen_vbd.h    |   24 ++++
 tools/libxen/include/xen_vif.h    |   24 ++++
 tools/libxen/src/xen_vbd.c        |   59 +++++++++++
 tools/libxen/src/xen_vif.c        |   59 +++++++++++
 5 files changed, 364 insertions(+)

diff -r 532a25342a30 -r cfd23ac1b32a docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex Sun Feb 25 22:31:43 2007 +0000
+++ b/docs/xen-api/xenapi-datamodel.tex Sun Feb 25 22:47:29 2007 +0000
@@ -6844,6 +6844,9 @@ Quals & Field & Type & Description \\
 $\mathit{RO}_\mathit{ins}$ &  {\tt VM} & VM ref & virtual machine to which 
this vif is connected \\
 $\mathit{RW}$ &  {\tt MAC} & string & ethernet MAC address of virtual 
interface, as exposed to guest \\
 $\mathit{RW}$ &  {\tt MTU} & int & MTU in octets \\
+$\mathit{RO}_\mathit{run}$ &  {\tt currently\_attached} & bool & is the device 
currently attached (erased on reboot) \\
+$\mathit{RO}_\mathit{run}$ &  {\tt status\_code} & int & error/success code 
associated with last attach-operation (erased on reboot) \\
+$\mathit{RO}_\mathit{run}$ &  {\tt status\_detail} & string & error/success 
information associated with last attach-operation status (erased on reboot) \\
 $\mathit{RW}$ &  {\tt qos/algorithm\_type} & string & QoS algorithm to use \\
 $\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) 
Map & parameters for chosen QoS algorithm \\
 $\mathit{RO}_\mathit{run}$ &  {\tt qos/supported\_algorithms} & string Set & 
supported QoS algorithms for this VIF \\
@@ -7142,6 +7145,102 @@ void
 
 
 
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_currently\_attached}
+
+{\bf Overview:} 
+Get the currently\_attached field of the given VIF.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} bool get_currently_attached (session_id s, VIF ref 
self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VIF ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+bool
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_status\_code}
+
+{\bf Overview:} 
+Get the status\_code field of the given VIF.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} int get_status_code (session_id s, VIF ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VIF ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+int
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_status\_detail}
+
+{\bf Overview:} 
+Get the status\_detail field of the given VIF.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} string get_status_detail (session_id s, VIF ref 
self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VIF ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+string
+}
+
+
+value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
@@ -9984,6 +10083,9 @@ Quals & Field & Type & Description \\
 $\mathit{RW}$ &  {\tt bootable} & bool & true if this VBD is bootable \\
 $\mathit{RW}$ &  {\tt mode} & vbd\_mode & the mode the VBD should be mounted 
with \\
 $\mathit{RW}$ &  {\tt type} & vbd\_type & how the VBD will appear to the guest 
(e.g. disk or CD) \\
+$\mathit{RO}_\mathit{run}$ &  {\tt currently\_attached} & bool & is the device 
currently attached (erased on reboot) \\
+$\mathit{RO}_\mathit{run}$ &  {\tt status\_code} & int & error/success code 
associated with last attach-operation (erased on reboot) \\
+$\mathit{RO}_\mathit{run}$ &  {\tt status\_detail} & string & error/success 
information associated with last attach-operation status (erased on reboot) \\
 $\mathit{RW}$ &  {\tt qos/algorithm\_type} & string & QoS algorithm to use \\
 $\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) 
Map & parameters for chosen QoS algorithm \\
 $\mathit{RO}_\mathit{run}$ &  {\tt qos/supported\_algorithms} & string Set & 
supported QoS algorithms for this VBD \\
@@ -10383,6 +10485,102 @@ void
 
 
 
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_currently\_attached}
+
+{\bf Overview:} 
+Get the currently\_attached field of the given VBD.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} bool get_currently_attached (session_id s, VBD ref 
self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VBD ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+bool
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_status\_code}
+
+{\bf Overview:} 
+Get the status\_code field of the given VBD.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} int get_status_code (session_id s, VBD ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VBD ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+int
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_status\_detail}
+
+{\bf Overview:} 
+Get the status\_detail field of the given VBD.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} string get_status_detail (session_id s, VBD ref 
self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VBD ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+string
+}
+
+
+value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
diff -r 532a25342a30 -r cfd23ac1b32a tools/libxen/include/xen_vbd.h
--- a/tools/libxen/include/xen_vbd.h    Sun Feb 25 22:31:43 2007 +0000
+++ b/tools/libxen/include/xen_vbd.h    Sun Feb 25 22:47:29 2007 +0000
@@ -76,6 +76,9 @@ typedef struct xen_vbd_record
     bool bootable;
     enum xen_vbd_mode mode;
     enum xen_vbd_type type;
+    bool currently_attached;
+    int64_t status_code;
+    char *status_detail;
     char *qos_algorithm_type;
     xen_string_string_map *qos_algorithm_params;
     struct xen_string_set *qos_supported_algorithms;
@@ -239,6 +242,27 @@ xen_vbd_get_type(xen_session *session, e
 
 
 /**
+ * Get the currently_attached field of the given VBD.
+ */
+extern bool
+xen_vbd_get_currently_attached(xen_session *session, bool *result, xen_vbd 
vbd);
+
+
+/**
+ * Get the status_code field of the given VBD.
+ */
+extern bool
+xen_vbd_get_status_code(xen_session *session, int64_t *result, xen_vbd vbd);
+
+
+/**
+ * Get the status_detail field of the given VBD.
+ */
+extern bool
+xen_vbd_get_status_detail(xen_session *session, char **result, xen_vbd vbd);
+
+
+/**
  * Get the qos/algorithm_type field of the given VBD.
  */
 extern bool
diff -r 532a25342a30 -r cfd23ac1b32a tools/libxen/include/xen_vif.h
--- a/tools/libxen/include/xen_vif.h    Sun Feb 25 22:31:43 2007 +0000
+++ b/tools/libxen/include/xen_vif.h    Sun Feb 25 22:47:29 2007 +0000
@@ -72,6 +72,9 @@ typedef struct xen_vif_record
     struct xen_vm_record_opt *vm;
     char *mac;
     int64_t mtu;
+    bool currently_attached;
+    int64_t status_code;
+    char *status_detail;
     char *qos_algorithm_type;
     xen_string_string_map *qos_algorithm_params;
     struct xen_string_set *qos_supported_algorithms;
@@ -228,6 +231,27 @@ xen_vif_get_mtu(xen_session *session, in
 
 
 /**
+ * Get the currently_attached field of the given VIF.
+ */
+extern bool
+xen_vif_get_currently_attached(xen_session *session, bool *result, xen_vif 
vif);
+
+
+/**
+ * Get the status_code field of the given VIF.
+ */
+extern bool
+xen_vif_get_status_code(xen_session *session, int64_t *result, xen_vif vif);
+
+
+/**
+ * Get the status_detail field of the given VIF.
+ */
+extern bool
+xen_vif_get_status_detail(xen_session *session, char **result, xen_vif vif);
+
+
+/**
  * Get the qos/algorithm_type field of the given VIF.
  */
 extern bool
diff -r 532a25342a30 -r cfd23ac1b32a tools/libxen/src/xen_vbd.c
--- a/tools/libxen/src/xen_vbd.c        Sun Feb 25 22:31:43 2007 +0000
+++ b/tools/libxen/src/xen_vbd.c        Sun Feb 25 22:47:29 2007 +0000
@@ -66,6 +66,15 @@ static const struct_member xen_vbd_recor
         { .key = "type",
           .type = &xen_vbd_type_abstract_type_,
           .offset = offsetof(xen_vbd_record, type) },
+        { .key = "currently_attached",
+          .type = &abstract_type_bool,
+          .offset = offsetof(xen_vbd_record, currently_attached) },
+        { .key = "status_code",
+          .type = &abstract_type_int,
+          .offset = offsetof(xen_vbd_record, status_code) },
+        { .key = "status_detail",
+          .type = &abstract_type_string,
+          .offset = offsetof(xen_vbd_record, status_detail) },
         { .key = "qos_algorithm_type",
           .type = &abstract_type_string,
           .offset = offsetof(xen_vbd_record, qos_algorithm_type) },
@@ -102,6 +111,7 @@ xen_vbd_record_free(xen_vbd_record *reco
     xen_vm_record_opt_free(record->vm);
     xen_vdi_record_opt_free(record->vdi);
     free(record->device);
+    free(record->status_detail);
     free(record->qos_algorithm_type);
     xen_string_string_map_free(record->qos_algorithm_params);
     xen_string_set_free(record->qos_supported_algorithms);
@@ -279,6 +289,55 @@ xen_vbd_get_type(xen_session *session, e
 
 
 bool
+xen_vbd_get_currently_attached(xen_session *session, bool *result, xen_vbd vbd)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vbd }
+        };
+
+    abstract_type result_type = abstract_type_bool;
+
+    XEN_CALL_("VBD.get_currently_attached");
+    return session->ok;
+}
+
+
+bool
+xen_vbd_get_status_code(xen_session *session, int64_t *result, xen_vbd vbd)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vbd }
+        };
+
+    abstract_type result_type = abstract_type_int;
+
+    XEN_CALL_("VBD.get_status_code");
+    return session->ok;
+}
+
+
+bool
+xen_vbd_get_status_detail(xen_session *session, char **result, xen_vbd vbd)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vbd }
+        };
+
+    abstract_type result_type = abstract_type_string;
+
+    *result = NULL;
+    XEN_CALL_("VBD.get_status_detail");
+    return session->ok;
+}
+
+
+bool
 xen_vbd_get_qos_algorithm_type(xen_session *session, char **result, xen_vbd 
vbd)
 {
     abstract_value param_values[] =
diff -r 532a25342a30 -r cfd23ac1b32a tools/libxen/src/xen_vif.c
--- a/tools/libxen/src/xen_vif.c        Sun Feb 25 22:31:43 2007 +0000
+++ b/tools/libxen/src/xen_vif.c        Sun Feb 25 22:47:29 2007 +0000
@@ -58,6 +58,15 @@ static const struct_member xen_vif_recor
         { .key = "MTU",
           .type = &abstract_type_int,
           .offset = offsetof(xen_vif_record, mtu) },
+        { .key = "currently_attached",
+          .type = &abstract_type_bool,
+          .offset = offsetof(xen_vif_record, currently_attached) },
+        { .key = "status_code",
+          .type = &abstract_type_int,
+          .offset = offsetof(xen_vif_record, status_code) },
+        { .key = "status_detail",
+          .type = &abstract_type_string,
+          .offset = offsetof(xen_vif_record, status_detail) },
         { .key = "qos_algorithm_type",
           .type = &abstract_type_string,
           .offset = offsetof(xen_vif_record, qos_algorithm_type) },
@@ -95,6 +104,7 @@ xen_vif_record_free(xen_vif_record *reco
     xen_network_record_opt_free(record->network);
     xen_vm_record_opt_free(record->vm);
     free(record->mac);
+    free(record->status_detail);
     free(record->qos_algorithm_type);
     xen_string_string_map_free(record->qos_algorithm_params);
     xen_string_set_free(record->qos_supported_algorithms);
@@ -259,6 +269,55 @@ xen_vif_get_mtu(xen_session *session, in
 
 
 bool
+xen_vif_get_currently_attached(xen_session *session, bool *result, xen_vif vif)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vif }
+        };
+
+    abstract_type result_type = abstract_type_bool;
+
+    XEN_CALL_("VIF.get_currently_attached");
+    return session->ok;
+}
+
+
+bool
+xen_vif_get_status_code(xen_session *session, int64_t *result, xen_vif vif)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vif }
+        };
+
+    abstract_type result_type = abstract_type_int;
+
+    XEN_CALL_("VIF.get_status_code");
+    return session->ok;
+}
+
+
+bool
+xen_vif_get_status_detail(xen_session *session, char **result, xen_vif vif)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vif }
+        };
+
+    abstract_type result_type = abstract_type_string;
+
+    *result = NULL;
+    XEN_CALL_("VIF.get_status_detail");
+    return session->ok;
+}
+
+
+bool
 xen_vif_get_qos_algorithm_type(xen_session *session, char **result, xen_vif 
vif)
 {
     abstract_value param_values[] =

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.