ia64/xen-unstable
changeset 14122:cfd23ac1b32a
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@xensource.com>
currently_attached fields. Not yet implemented.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
author | Ewan Mellor <ewan@xensource.com> |
---|---|
date | Sun Feb 25 22:47:29 2007 +0000 (2007-02-25) |
parents | 532a25342a30 |
children | e71b277f1533 |
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 Sun Feb 25 22:31:43 2007 +0000 1.2 +++ b/docs/xen-api/xenapi-datamodel.tex Sun Feb 25 22:47:29 2007 +0000 1.3 @@ -6844,6 +6844,9 @@ Quals & Field & Type & Description \\ 1.4 $\mathit{RO}_\mathit{ins}$ & {\tt VM} & VM ref & virtual machine to which this vif is connected \\ 1.5 $\mathit{RW}$ & {\tt MAC} & string & ethernet MAC address of virtual interface, as exposed to guest \\ 1.6 $\mathit{RW}$ & {\tt MTU} & int & MTU in octets \\ 1.7 +$\mathit{RO}_\mathit{run}$ & {\tt currently\_attached} & bool & is the device currently attached (erased on reboot) \\ 1.8 +$\mathit{RO}_\mathit{run}$ & {\tt status\_code} & int & error/success code associated with last attach-operation (erased on reboot) \\ 1.9 +$\mathit{RO}_\mathit{run}$ & {\tt status\_detail} & string & error/success information associated with last attach-operation status (erased on reboot) \\ 1.10 $\mathit{RW}$ & {\tt qos/algorithm\_type} & string & QoS algorithm to use \\ 1.11 $\mathit{RW}$ & {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & parameters for chosen QoS algorithm \\ 1.12 $\mathit{RO}_\mathit{run}$ & {\tt qos/supported\_algorithms} & string Set & supported QoS algorithms for this VIF \\ 1.13 @@ -7145,6 +7148,102 @@ void 1.14 \vspace{0.3cm} 1.15 \vspace{0.3cm} 1.16 \vspace{0.3cm} 1.17 +\subsubsection{RPC name:~get\_currently\_attached} 1.18 + 1.19 +{\bf Overview:} 1.20 +Get the currently\_attached field of the given VIF. 1.21 + 1.22 + \noindent {\bf Signature:} 1.23 +\begin{verbatim} bool get_currently_attached (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 +bool 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\_status\_code} 1.50 + 1.51 +{\bf Overview:} 1.52 +Get the status\_code field of the given VIF. 1.53 + 1.54 + \noindent {\bf Signature:} 1.55 +\begin{verbatim} int get_status_code (session_id s, VIF ref self)\end{verbatim} 1.56 + 1.57 + 1.58 +\noindent{\bf Arguments:} 1.59 + 1.60 + 1.61 +\vspace{0.3cm} 1.62 +\begin{tabular}{|c|c|p{7cm}|} 1.63 + \hline 1.64 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.65 +{\tt VIF ref } & self & reference to the object \\ \hline 1.66 + 1.67 +\end{tabular} 1.68 + 1.69 +\vspace{0.3cm} 1.70 + 1.71 + \noindent {\bf Return Type:} 1.72 +{\tt 1.73 +int 1.74 +} 1.75 + 1.76 + 1.77 +value of the field 1.78 +\vspace{0.3cm} 1.79 +\vspace{0.3cm} 1.80 +\vspace{0.3cm} 1.81 +\subsubsection{RPC name:~get\_status\_detail} 1.82 + 1.83 +{\bf Overview:} 1.84 +Get the status\_detail field of the given VIF. 1.85 + 1.86 + \noindent {\bf Signature:} 1.87 +\begin{verbatim} string get_status_detail (session_id s, VIF ref self)\end{verbatim} 1.88 + 1.89 + 1.90 +\noindent{\bf Arguments:} 1.91 + 1.92 + 1.93 +\vspace{0.3cm} 1.94 +\begin{tabular}{|c|c|p{7cm}|} 1.95 + \hline 1.96 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.97 +{\tt VIF ref } & self & reference to the object \\ \hline 1.98 + 1.99 +\end{tabular} 1.100 + 1.101 +\vspace{0.3cm} 1.102 + 1.103 + \noindent {\bf Return Type:} 1.104 +{\tt 1.105 +string 1.106 +} 1.107 + 1.108 + 1.109 +value of the field 1.110 +\vspace{0.3cm} 1.111 +\vspace{0.3cm} 1.112 +\vspace{0.3cm} 1.113 \subsubsection{RPC name:~get\_qos\_algorithm\_type} 1.114 1.115 {\bf Overview:} 1.116 @@ -9984,6 +10083,9 @@ Quals & Field & Type & Description \\ 1.117 $\mathit{RW}$ & {\tt bootable} & bool & true if this VBD is bootable \\ 1.118 $\mathit{RW}$ & {\tt mode} & vbd\_mode & the mode the VBD should be mounted with \\ 1.119 $\mathit{RW}$ & {\tt type} & vbd\_type & how the VBD will appear to the guest (e.g. disk or CD) \\ 1.120 +$\mathit{RO}_\mathit{run}$ & {\tt currently\_attached} & bool & is the device currently attached (erased on reboot) \\ 1.121 +$\mathit{RO}_\mathit{run}$ & {\tt status\_code} & int & error/success code associated with last attach-operation (erased on reboot) \\ 1.122 +$\mathit{RO}_\mathit{run}$ & {\tt status\_detail} & string & error/success information associated with last attach-operation status (erased on reboot) \\ 1.123 $\mathit{RW}$ & {\tt qos/algorithm\_type} & string & QoS algorithm to use \\ 1.124 $\mathit{RW}$ & {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & parameters for chosen QoS algorithm \\ 1.125 $\mathit{RO}_\mathit{run}$ & {\tt qos/supported\_algorithms} & string Set & supported QoS algorithms for this VBD \\ 1.126 @@ -10386,6 +10488,102 @@ void 1.127 \vspace{0.3cm} 1.128 \vspace{0.3cm} 1.129 \vspace{0.3cm} 1.130 +\subsubsection{RPC name:~get\_currently\_attached} 1.131 + 1.132 +{\bf Overview:} 1.133 +Get the currently\_attached field of the given VBD. 1.134 + 1.135 + \noindent {\bf Signature:} 1.136 +\begin{verbatim} bool get_currently_attached (session_id s, VBD ref self)\end{verbatim} 1.137 + 1.138 + 1.139 +\noindent{\bf Arguments:} 1.140 + 1.141 + 1.142 +\vspace{0.3cm} 1.143 +\begin{tabular}{|c|c|p{7cm}|} 1.144 + \hline 1.145 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.146 +{\tt VBD ref } & self & reference to the object \\ \hline 1.147 + 1.148 +\end{tabular} 1.149 + 1.150 +\vspace{0.3cm} 1.151 + 1.152 + \noindent {\bf Return Type:} 1.153 +{\tt 1.154 +bool 1.155 +} 1.156 + 1.157 + 1.158 +value of the field 1.159 +\vspace{0.3cm} 1.160 +\vspace{0.3cm} 1.161 +\vspace{0.3cm} 1.162 +\subsubsection{RPC name:~get\_status\_code} 1.163 + 1.164 +{\bf Overview:} 1.165 +Get the status\_code field of the given VBD. 1.166 + 1.167 + \noindent {\bf Signature:} 1.168 +\begin{verbatim} int get_status_code (session_id s, VBD ref self)\end{verbatim} 1.169 + 1.170 + 1.171 +\noindent{\bf Arguments:} 1.172 + 1.173 + 1.174 +\vspace{0.3cm} 1.175 +\begin{tabular}{|c|c|p{7cm}|} 1.176 + \hline 1.177 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.178 +{\tt VBD ref } & self & reference to the object \\ \hline 1.179 + 1.180 +\end{tabular} 1.181 + 1.182 +\vspace{0.3cm} 1.183 + 1.184 + \noindent {\bf Return Type:} 1.185 +{\tt 1.186 +int 1.187 +} 1.188 + 1.189 + 1.190 +value of the field 1.191 +\vspace{0.3cm} 1.192 +\vspace{0.3cm} 1.193 +\vspace{0.3cm} 1.194 +\subsubsection{RPC name:~get\_status\_detail} 1.195 + 1.196 +{\bf Overview:} 1.197 +Get the status\_detail field of the given VBD. 1.198 + 1.199 + \noindent {\bf Signature:} 1.200 +\begin{verbatim} string get_status_detail (session_id s, VBD ref self)\end{verbatim} 1.201 + 1.202 + 1.203 +\noindent{\bf Arguments:} 1.204 + 1.205 + 1.206 +\vspace{0.3cm} 1.207 +\begin{tabular}{|c|c|p{7cm}|} 1.208 + \hline 1.209 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.210 +{\tt VBD ref } & self & reference to the object \\ \hline 1.211 + 1.212 +\end{tabular} 1.213 + 1.214 +\vspace{0.3cm} 1.215 + 1.216 + \noindent {\bf Return Type:} 1.217 +{\tt 1.218 +string 1.219 +} 1.220 + 1.221 + 1.222 +value of the field 1.223 +\vspace{0.3cm} 1.224 +\vspace{0.3cm} 1.225 +\vspace{0.3cm} 1.226 \subsubsection{RPC name:~get\_qos\_algorithm\_type} 1.227 1.228 {\bf Overview:}
2.1 --- a/tools/libxen/include/xen_vbd.h Sun Feb 25 22:31:43 2007 +0000 2.2 +++ b/tools/libxen/include/xen_vbd.h Sun Feb 25 22:47:29 2007 +0000 2.3 @@ -76,6 +76,9 @@ typedef struct xen_vbd_record 2.4 bool bootable; 2.5 enum xen_vbd_mode mode; 2.6 enum xen_vbd_type type; 2.7 + bool currently_attached; 2.8 + int64_t status_code; 2.9 + char *status_detail; 2.10 char *qos_algorithm_type; 2.11 xen_string_string_map *qos_algorithm_params; 2.12 struct xen_string_set *qos_supported_algorithms; 2.13 @@ -239,6 +242,27 @@ xen_vbd_get_type(xen_session *session, e 2.14 2.15 2.16 /** 2.17 + * Get the currently_attached field of the given VBD. 2.18 + */ 2.19 +extern bool 2.20 +xen_vbd_get_currently_attached(xen_session *session, bool *result, xen_vbd vbd); 2.21 + 2.22 + 2.23 +/** 2.24 + * Get the status_code field of the given VBD. 2.25 + */ 2.26 +extern bool 2.27 +xen_vbd_get_status_code(xen_session *session, int64_t *result, xen_vbd vbd); 2.28 + 2.29 + 2.30 +/** 2.31 + * Get the status_detail field of the given VBD. 2.32 + */ 2.33 +extern bool 2.34 +xen_vbd_get_status_detail(xen_session *session, char **result, xen_vbd vbd); 2.35 + 2.36 + 2.37 +/** 2.38 * Get the qos/algorithm_type field of the given VBD. 2.39 */ 2.40 extern bool
3.1 --- a/tools/libxen/include/xen_vif.h Sun Feb 25 22:31:43 2007 +0000 3.2 +++ b/tools/libxen/include/xen_vif.h Sun Feb 25 22:47:29 2007 +0000 3.3 @@ -72,6 +72,9 @@ typedef struct xen_vif_record 3.4 struct xen_vm_record_opt *vm; 3.5 char *mac; 3.6 int64_t mtu; 3.7 + bool currently_attached; 3.8 + int64_t status_code; 3.9 + char *status_detail; 3.10 char *qos_algorithm_type; 3.11 xen_string_string_map *qos_algorithm_params; 3.12 struct xen_string_set *qos_supported_algorithms; 3.13 @@ -228,6 +231,27 @@ xen_vif_get_mtu(xen_session *session, in 3.14 3.15 3.16 /** 3.17 + * Get the currently_attached field of the given VIF. 3.18 + */ 3.19 +extern bool 3.20 +xen_vif_get_currently_attached(xen_session *session, bool *result, xen_vif vif); 3.21 + 3.22 + 3.23 +/** 3.24 + * Get the status_code field of the given VIF. 3.25 + */ 3.26 +extern bool 3.27 +xen_vif_get_status_code(xen_session *session, int64_t *result, xen_vif vif); 3.28 + 3.29 + 3.30 +/** 3.31 + * Get the status_detail field of the given VIF. 3.32 + */ 3.33 +extern bool 3.34 +xen_vif_get_status_detail(xen_session *session, char **result, xen_vif vif); 3.35 + 3.36 + 3.37 +/** 3.38 * Get the qos/algorithm_type field of the given VIF. 3.39 */ 3.40 extern bool
4.1 --- a/tools/libxen/src/xen_vbd.c Sun Feb 25 22:31:43 2007 +0000 4.2 +++ b/tools/libxen/src/xen_vbd.c Sun Feb 25 22:47:29 2007 +0000 4.3 @@ -66,6 +66,15 @@ static const struct_member xen_vbd_recor 4.4 { .key = "type", 4.5 .type = &xen_vbd_type_abstract_type_, 4.6 .offset = offsetof(xen_vbd_record, type) }, 4.7 + { .key = "currently_attached", 4.8 + .type = &abstract_type_bool, 4.9 + .offset = offsetof(xen_vbd_record, currently_attached) }, 4.10 + { .key = "status_code", 4.11 + .type = &abstract_type_int, 4.12 + .offset = offsetof(xen_vbd_record, status_code) }, 4.13 + { .key = "status_detail", 4.14 + .type = &abstract_type_string, 4.15 + .offset = offsetof(xen_vbd_record, status_detail) }, 4.16 { .key = "qos_algorithm_type", 4.17 .type = &abstract_type_string, 4.18 .offset = offsetof(xen_vbd_record, qos_algorithm_type) }, 4.19 @@ -102,6 +111,7 @@ xen_vbd_record_free(xen_vbd_record *reco 4.20 xen_vm_record_opt_free(record->vm); 4.21 xen_vdi_record_opt_free(record->vdi); 4.22 free(record->device); 4.23 + free(record->status_detail); 4.24 free(record->qos_algorithm_type); 4.25 xen_string_string_map_free(record->qos_algorithm_params); 4.26 xen_string_set_free(record->qos_supported_algorithms); 4.27 @@ -279,6 +289,55 @@ xen_vbd_get_type(xen_session *session, e 4.28 4.29 4.30 bool 4.31 +xen_vbd_get_currently_attached(xen_session *session, bool *result, xen_vbd vbd) 4.32 +{ 4.33 + abstract_value param_values[] = 4.34 + { 4.35 + { .type = &abstract_type_string, 4.36 + .u.string_val = vbd } 4.37 + }; 4.38 + 4.39 + abstract_type result_type = abstract_type_bool; 4.40 + 4.41 + XEN_CALL_("VBD.get_currently_attached"); 4.42 + return session->ok; 4.43 +} 4.44 + 4.45 + 4.46 +bool 4.47 +xen_vbd_get_status_code(xen_session *session, int64_t *result, xen_vbd vbd) 4.48 +{ 4.49 + abstract_value param_values[] = 4.50 + { 4.51 + { .type = &abstract_type_string, 4.52 + .u.string_val = vbd } 4.53 + }; 4.54 + 4.55 + abstract_type result_type = abstract_type_int; 4.56 + 4.57 + XEN_CALL_("VBD.get_status_code"); 4.58 + return session->ok; 4.59 +} 4.60 + 4.61 + 4.62 +bool 4.63 +xen_vbd_get_status_detail(xen_session *session, char **result, xen_vbd vbd) 4.64 +{ 4.65 + abstract_value param_values[] = 4.66 + { 4.67 + { .type = &abstract_type_string, 4.68 + .u.string_val = vbd } 4.69 + }; 4.70 + 4.71 + abstract_type result_type = abstract_type_string; 4.72 + 4.73 + *result = NULL; 4.74 + XEN_CALL_("VBD.get_status_detail"); 4.75 + return session->ok; 4.76 +} 4.77 + 4.78 + 4.79 +bool 4.80 xen_vbd_get_qos_algorithm_type(xen_session *session, char **result, xen_vbd vbd) 4.81 { 4.82 abstract_value param_values[] =
5.1 --- a/tools/libxen/src/xen_vif.c Sun Feb 25 22:31:43 2007 +0000 5.2 +++ b/tools/libxen/src/xen_vif.c Sun Feb 25 22:47:29 2007 +0000 5.3 @@ -58,6 +58,15 @@ static const struct_member xen_vif_recor 5.4 { .key = "MTU", 5.5 .type = &abstract_type_int, 5.6 .offset = offsetof(xen_vif_record, mtu) }, 5.7 + { .key = "currently_attached", 5.8 + .type = &abstract_type_bool, 5.9 + .offset = offsetof(xen_vif_record, currently_attached) }, 5.10 + { .key = "status_code", 5.11 + .type = &abstract_type_int, 5.12 + .offset = offsetof(xen_vif_record, status_code) }, 5.13 + { .key = "status_detail", 5.14 + .type = &abstract_type_string, 5.15 + .offset = offsetof(xen_vif_record, status_detail) }, 5.16 { .key = "qos_algorithm_type", 5.17 .type = &abstract_type_string, 5.18 .offset = offsetof(xen_vif_record, qos_algorithm_type) }, 5.19 @@ -95,6 +104,7 @@ xen_vif_record_free(xen_vif_record *reco 5.20 xen_network_record_opt_free(record->network); 5.21 xen_vm_record_opt_free(record->vm); 5.22 free(record->mac); 5.23 + free(record->status_detail); 5.24 free(record->qos_algorithm_type); 5.25 xen_string_string_map_free(record->qos_algorithm_params); 5.26 xen_string_set_free(record->qos_supported_algorithms); 5.27 @@ -259,6 +269,55 @@ xen_vif_get_mtu(xen_session *session, in 5.28 5.29 5.30 bool 5.31 +xen_vif_get_currently_attached(xen_session *session, bool *result, xen_vif vif) 5.32 +{ 5.33 + abstract_value param_values[] = 5.34 + { 5.35 + { .type = &abstract_type_string, 5.36 + .u.string_val = vif } 5.37 + }; 5.38 + 5.39 + abstract_type result_type = abstract_type_bool; 5.40 + 5.41 + XEN_CALL_("VIF.get_currently_attached"); 5.42 + return session->ok; 5.43 +} 5.44 + 5.45 + 5.46 +bool 5.47 +xen_vif_get_status_code(xen_session *session, int64_t *result, xen_vif vif) 5.48 +{ 5.49 + abstract_value param_values[] = 5.50 + { 5.51 + { .type = &abstract_type_string, 5.52 + .u.string_val = vif } 5.53 + }; 5.54 + 5.55 + abstract_type result_type = abstract_type_int; 5.56 + 5.57 + XEN_CALL_("VIF.get_status_code"); 5.58 + return session->ok; 5.59 +} 5.60 + 5.61 + 5.62 +bool 5.63 +xen_vif_get_status_detail(xen_session *session, char **result, xen_vif vif) 5.64 +{ 5.65 + abstract_value param_values[] = 5.66 + { 5.67 + { .type = &abstract_type_string, 5.68 + .u.string_val = vif } 5.69 + }; 5.70 + 5.71 + abstract_type result_type = abstract_type_string; 5.72 + 5.73 + *result = NULL; 5.74 + XEN_CALL_("VIF.get_status_detail"); 5.75 + return session->ok; 5.76 +} 5.77 + 5.78 + 5.79 +bool 5.80 xen_vif_get_qos_algorithm_type(xen_session *session, char **result, xen_vif vif) 5.81 { 5.82 abstract_value param_values[] =