[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Added modelling and C bindings for VIF/VBD QoS parameter setting. No Xend
# HG changeset patch # User Ewan Mellor <ewan@xxxxxxxxxxxxx> # Date 1172011255 0 # Node ID bab07bed5c0a6e4d6f41f0990ca478345ea259f8 # Parent 0aa6755159d54fc1217bfde847befd3d3df78711 Added modelling and C bindings for VIF/VBD QoS parameter setting. No Xend implementation yet. Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx> --- docs/xen-api/xenapi-datamodel.tex | 414 ++++++++++++++++++++++++++++++++++++++ tools/libxen/include/xen_vbd.h | 48 ++++ tools/libxen/include/xen_vif.h | 48 ++++ tools/libxen/src/xen_vbd.c | 109 ++++++++++ tools/libxen/src/xen_vif.c | 109 ++++++++++ 5 files changed, 728 insertions(+) diff -r 0aa6755159d5 -r bab07bed5c0a docs/xen-api/xenapi-datamodel.tex --- a/docs/xen-api/xenapi-datamodel.tex Tue Feb 20 21:55:11 2007 +0000 +++ b/docs/xen-api/xenapi-datamodel.tex Tue Feb 20 22:40:55 2007 +0000 @@ -6710,6 +6710,8 @@ 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{RW}$ & {\tt qos/algorithm\_type} & string & QoS algorithm to use \\ +$\mathit{RW}$ & {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & Paramters for chosen QoS algorithm \\ $\mathit{RO}_\mathit{run}$ & {\tt metrics} & VIF\_metrics ref & metrics associated with this VIF. \\ \hline \end{longtable} @@ -6993,6 +6995,211 @@ Set the MTU field of the given VIF. {\tt VIF ref } & self & reference to the object \\ \hline {\tt int } & value & New value to set \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~get\_qos\_algorithm\_type} + +{\bf Overview:} +Get the qos/algorithm\_type field of the given VIF. + + \noindent {\bf Signature:} +\begin{verbatim} string get_qos_algorithm_type (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} +\subsubsection{RPC name:~set\_qos\_algorithm\_type} + +{\bf Overview:} +Set the qos/algorithm\_type field of the given VIF. + + \noindent {\bf Signature:} +\begin{verbatim} void set_qos_algorithm_type (session_id s, VIF ref self, string value)\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 + +{\tt string } & value & New value to set \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~get\_qos\_algorithm\_params} + +{\bf Overview:} +Get the qos/algorithm\_params field of the given VIF. + + \noindent {\bf Signature:} +\begin{verbatim} ((string -> string) Map) get_qos_algorithm_params (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 $\rightarrow$ string) Map +} + + +value of the field +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~set\_qos\_algorithm\_params} + +{\bf Overview:} +Set the qos/algorithm\_params field of the given VIF. + + \noindent {\bf Signature:} +\begin{verbatim} void set_qos_algorithm_params (session_id s, VIF ref self, (string -> string) Map value)\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 + +{\tt (string $\rightarrow$ string) Map } & value & New value to set \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~add\_to\_qos\_algorithm\_params} + +{\bf Overview:} +Add the given key-value pair to the qos/algorithm\_params field of the +given VIF. + + \noindent {\bf Signature:} +\begin{verbatim} void add_to_qos_algorithm_params (session_id s, VIF ref self, string key, string value)\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 + +{\tt string } & key & Key to add \\ \hline + +{\tt string } & value & Value to add \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~remove\_from\_qos\_algorithm\_params} + +{\bf Overview:} +Remove the given key and its corresponding value from the +qos/algorithm\_params field of the given VIF. If the key is not in that +Map, then do nothing. + + \noindent {\bf Signature:} +\begin{verbatim} void remove_from_qos_algorithm_params (session_id s, VIF ref self, string key)\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 + +{\tt string } & key & Key to remove \\ \hline \end{tabular} @@ -9610,6 +9817,8 @@ 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{RW}$ & {\tt qos/algorithm\_type} & string & QoS algorithm to use \\ +$\mathit{RW}$ & {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & Paramters for chosen QoS algorithm \\ $\mathit{RO}_\mathit{run}$ & {\tt metrics} & VBD\_metrics ref & metrics associated with this VBD. \\ \hline \end{longtable} @@ -9994,6 +10203,211 @@ Set the type field of the given VBD. {\tt VBD ref } & self & reference to the object \\ \hline {\tt vbd\_type } & value & New value to set \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~get\_qos\_algorithm\_type} + +{\bf Overview:} +Get the qos/algorithm\_type field of the given VBD. + + \noindent {\bf Signature:} +\begin{verbatim} string get_qos_algorithm_type (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} +\subsubsection{RPC name:~set\_qos\_algorithm\_type} + +{\bf Overview:} +Set the qos/algorithm\_type field of the given VBD. + + \noindent {\bf Signature:} +\begin{verbatim} void set_qos_algorithm_type (session_id s, VBD ref self, string value)\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 + +{\tt string } & value & New value to set \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~get\_qos\_algorithm\_params} + +{\bf Overview:} +Get the qos/algorithm\_params field of the given VBD. + + \noindent {\bf Signature:} +\begin{verbatim} ((string -> string) Map) get_qos_algorithm_params (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 $\rightarrow$ string) Map +} + + +value of the field +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~set\_qos\_algorithm\_params} + +{\bf Overview:} +Set the qos/algorithm\_params field of the given VBD. + + \noindent {\bf Signature:} +\begin{verbatim} void set_qos_algorithm_params (session_id s, VBD ref self, (string -> string) Map value)\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 + +{\tt (string $\rightarrow$ string) Map } & value & New value to set \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~add\_to\_qos\_algorithm\_params} + +{\bf Overview:} +Add the given key-value pair to the qos/algorithm\_params field of the +given VBD. + + \noindent {\bf Signature:} +\begin{verbatim} void add_to_qos_algorithm_params (session_id s, VBD ref self, string key, string value)\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 + +{\tt string } & key & Key to add \\ \hline + +{\tt string } & value & Value to add \\ \hline + +\end{tabular} + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +void +} + + + +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~remove\_from\_qos\_algorithm\_params} + +{\bf Overview:} +Remove the given key and its corresponding value from the +qos/algorithm\_params field of the given VBD. If the key is not in that +Map, then do nothing. + + \noindent {\bf Signature:} +\begin{verbatim} void remove_from_qos_algorithm_params (session_id s, VBD ref self, string key)\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 + +{\tt string } & key & Key to remove \\ \hline \end{tabular} diff -r 0aa6755159d5 -r bab07bed5c0a tools/libxen/include/xen_vbd.h --- a/tools/libxen/include/xen_vbd.h Tue Feb 20 21:55:11 2007 +0000 +++ b/tools/libxen/include/xen_vbd.h Tue Feb 20 22:40:55 2007 +0000 @@ -20,6 +20,7 @@ #define XEN_VBD_H #include "xen_common.h" +#include "xen_string_string_map.h" #include "xen_vbd_decl.h" #include "xen_vbd_metrics_decl.h" #include "xen_vbd_mode.h" @@ -74,6 +75,8 @@ typedef struct xen_vbd_record bool bootable; enum xen_vbd_mode mode; enum xen_vbd_type type; + char *qos_algorithm_type; + xen_string_string_map *qos_algorithm_params; struct xen_vbd_metrics_record_opt *metrics; } xen_vbd_record; @@ -234,6 +237,20 @@ xen_vbd_get_type(xen_session *session, e /** + * Get the qos/algorithm_type field of the given VBD. + */ +extern bool +xen_vbd_get_qos_algorithm_type(xen_session *session, char **result, xen_vbd vbd); + + +/** + * Get the qos/algorithm_params field of the given VBD. + */ +extern bool +xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vbd vbd); + + +/** * Get the metrics field of the given VBD. */ extern bool @@ -266,6 +283,37 @@ xen_vbd_set_mode(xen_session *session, x */ extern bool xen_vbd_set_type(xen_session *session, xen_vbd vbd, enum xen_vbd_type type); + + +/** + * Set the qos/algorithm_type field of the given VBD. + */ +extern bool +xen_vbd_set_qos_algorithm_type(xen_session *session, xen_vbd vbd, char *algorithm_type); + + +/** + * Set the qos/algorithm_params field of the given VBD. + */ +extern bool +xen_vbd_set_qos_algorithm_params(xen_session *session, xen_vbd vbd, xen_string_string_map *algorithm_params); + + +/** + * Add the given key-value pair to the qos/algorithm_params field of + * the given VBD. + */ +extern bool +xen_vbd_add_to_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key, char *value); + + +/** + * Remove the given key and its corresponding value from the + * qos/algorithm_params field of the given VBD. If the key is not in that + * Map, then do nothing. + */ +extern bool +xen_vbd_remove_from_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key); /** diff -r 0aa6755159d5 -r bab07bed5c0a tools/libxen/include/xen_vif.h --- a/tools/libxen/include/xen_vif.h Tue Feb 20 21:55:11 2007 +0000 +++ b/tools/libxen/include/xen_vif.h Tue Feb 20 22:40:55 2007 +0000 @@ -21,6 +21,7 @@ #include "xen_common.h" #include "xen_network_decl.h" +#include "xen_string_string_map.h" #include "xen_vif_decl.h" #include "xen_vif_metrics_decl.h" #include "xen_vm_decl.h" @@ -70,6 +71,8 @@ typedef struct xen_vif_record struct xen_vm_record_opt *vm; char *mac; int64_t mtu; + char *qos_algorithm_type; + xen_string_string_map *qos_algorithm_params; struct xen_vif_metrics_record_opt *metrics; } xen_vif_record; @@ -223,6 +226,20 @@ xen_vif_get_mtu(xen_session *session, in /** + * Get the qos/algorithm_type field of the given VIF. + */ +extern bool +xen_vif_get_qos_algorithm_type(xen_session *session, char **result, xen_vif vif); + + +/** + * Get the qos/algorithm_params field of the given VIF. + */ +extern bool +xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vif vif); + + +/** * Get the metrics field of the given VIF. */ extern bool @@ -250,4 +267,35 @@ xen_vif_set_mtu(xen_session *session, xe xen_vif_set_mtu(xen_session *session, xen_vif vif, int64_t mtu); +/** + * Set the qos/algorithm_type field of the given VIF. + */ +extern bool +xen_vif_set_qos_algorithm_type(xen_session *session, xen_vif vif, char *algorithm_type); + + +/** + * Set the qos/algorithm_params field of the given VIF. + */ +extern bool +xen_vif_set_qos_algorithm_params(xen_session *session, xen_vif vif, xen_string_string_map *algorithm_params); + + +/** + * Add the given key-value pair to the qos/algorithm_params field of + * the given VIF. + */ +extern bool +xen_vif_add_to_qos_algorithm_params(xen_session *session, xen_vif vif, char *key, char *value); + + +/** + * Remove the given key and its corresponding value from the + * qos/algorithm_params field of the given VIF. If the key is not in that + * Map, then do nothing. + */ +extern bool +xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char *key); + + #endif diff -r 0aa6755159d5 -r bab07bed5c0a tools/libxen/src/xen_vbd.c --- a/tools/libxen/src/xen_vbd.c Tue Feb 20 21:55:11 2007 +0000 +++ b/tools/libxen/src/xen_vbd.c Tue Feb 20 22:40:55 2007 +0000 @@ -22,6 +22,7 @@ #include "xen_common.h" #include "xen_internal.h" +#include "xen_string_string_map.h" #include "xen_vbd.h" #include "xen_vbd_metrics.h" #include "xen_vbd_mode_internal.h" @@ -65,6 +66,12 @@ static const struct_member xen_vbd_recor { .key = "type", .type = &xen_vbd_type_abstract_type_, .offset = offsetof(xen_vbd_record, type) }, + { .key = "qos_algorithm_type", + .type = &abstract_type_string, + .offset = offsetof(xen_vbd_record, qos_algorithm_type) }, + { .key = "qos_algorithm_params", + .type = &abstract_type_string_string_map, + .offset = offsetof(xen_vbd_record, qos_algorithm_params) }, { .key = "metrics", .type = &abstract_type_ref, .offset = offsetof(xen_vbd_record, metrics) } @@ -92,6 +99,8 @@ 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->qos_algorithm_type); + xen_string_string_map_free(record->qos_algorithm_params); xen_vbd_metrics_record_opt_free(record->metrics); free(record); } @@ -266,6 +275,40 @@ xen_vbd_get_type(xen_session *session, e bool +xen_vbd_get_qos_algorithm_type(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_qos_algorithm_type"); + return session->ok; +} + + +bool +xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vbd vbd) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vbd } + }; + + abstract_type result_type = abstract_type_string_string_map; + + *result = NULL; + XEN_CALL_("VBD.get_qos_algorithm_params"); + return session->ok; +} + + +bool xen_vbd_get_metrics(xen_session *session, xen_vbd_metrics *result, xen_vbd vbd) { abstract_value param_values[] = @@ -347,6 +390,72 @@ xen_vbd_set_type(xen_session *session, x bool +xen_vbd_set_qos_algorithm_type(xen_session *session, xen_vbd vbd, char *algorithm_type) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vbd }, + { .type = &abstract_type_string, + .u.string_val = algorithm_type } + }; + + xen_call_(session, "VBD.set_qos_algorithm_type", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool +xen_vbd_set_qos_algorithm_params(xen_session *session, xen_vbd vbd, xen_string_string_map *algorithm_params) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vbd }, + { .type = &abstract_type_string_string_map, + .u.set_val = (arbitrary_set *)algorithm_params } + }; + + xen_call_(session, "VBD.set_qos_algorithm_params", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool +xen_vbd_add_to_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key, char *value) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vbd }, + { .type = &abstract_type_string, + .u.string_val = key }, + { .type = &abstract_type_string, + .u.string_val = value } + }; + + xen_call_(session, "VBD.add_to_qos_algorithm_params", param_values, 3, NULL, NULL); + return session->ok; +} + + +bool +xen_vbd_remove_from_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vbd }, + { .type = &abstract_type_string, + .u.string_val = key } + }; + + xen_call_(session, "VBD.remove_from_qos_algorithm_params", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi) { abstract_value param_values[] = diff -r 0aa6755159d5 -r bab07bed5c0a tools/libxen/src/xen_vif.c --- a/tools/libxen/src/xen_vif.c Tue Feb 20 21:55:11 2007 +0000 +++ b/tools/libxen/src/xen_vif.c Tue Feb 20 22:40:55 2007 +0000 @@ -23,6 +23,7 @@ #include "xen_common.h" #include "xen_internal.h" #include "xen_network.h" +#include "xen_string_string_map.h" #include "xen_vif.h" #include "xen_vif_metrics.h" #include "xen_vm.h" @@ -57,6 +58,12 @@ static const struct_member xen_vif_recor { .key = "MTU", .type = &abstract_type_int, .offset = offsetof(xen_vif_record, mtu) }, + { .key = "qos_algorithm_type", + .type = &abstract_type_string, + .offset = offsetof(xen_vif_record, qos_algorithm_type) }, + { .key = "qos_algorithm_params", + .type = &abstract_type_string_string_map, + .offset = offsetof(xen_vif_record, qos_algorithm_params) }, { .key = "metrics", .type = &abstract_type_ref, .offset = offsetof(xen_vif_record, metrics) } @@ -85,6 +92,8 @@ 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->qos_algorithm_type); + xen_string_string_map_free(record->qos_algorithm_params); xen_vif_metrics_record_opt_free(record->metrics); free(record); } @@ -246,6 +255,40 @@ xen_vif_get_mtu(xen_session *session, in bool +xen_vif_get_qos_algorithm_type(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_qos_algorithm_type"); + return session->ok; +} + + +bool +xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vif vif) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vif } + }; + + abstract_type result_type = abstract_type_string_string_map; + + *result = NULL; + XEN_CALL_("VIF.get_qos_algorithm_params"); + return session->ok; +} + + +bool xen_vif_get_metrics(xen_session *session, xen_vif_metrics *result, xen_vif vif) { abstract_value param_values[] = @@ -311,6 +354,72 @@ xen_vif_set_mtu(xen_session *session, xe bool +xen_vif_set_qos_algorithm_type(xen_session *session, xen_vif vif, char *algorithm_type) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vif }, + { .type = &abstract_type_string, + .u.string_val = algorithm_type } + }; + + xen_call_(session, "VIF.set_qos_algorithm_type", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool +xen_vif_set_qos_algorithm_params(xen_session *session, xen_vif vif, xen_string_string_map *algorithm_params) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vif }, + { .type = &abstract_type_string_string_map, + .u.set_val = (arbitrary_set *)algorithm_params } + }; + + xen_call_(session, "VIF.set_qos_algorithm_params", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool +xen_vif_add_to_qos_algorithm_params(xen_session *session, xen_vif vif, char *key, char *value) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vif }, + { .type = &abstract_type_string, + .u.string_val = key }, + { .type = &abstract_type_string, + .u.string_val = value } + }; + + xen_call_(session, "VIF.add_to_qos_algorithm_params", param_values, 3, NULL, NULL); + return session->ok; +} + + +bool +xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char *key) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vif }, + { .type = &abstract_type_string, + .u.string_val = key } + }; + + xen_call_(session, "VIF.remove_from_qos_algorithm_params", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool xen_vif_get_uuid(xen_session *session, char **result, xen_vif vif) { *result = session->ok ? xen_strdup_((char *)vif) : NULL; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |