diff options
author | Ewan Mellor <ewan@xensource.com> | 2007-02-21 23:03:00 +0000 |
---|---|---|
committer | Ewan Mellor <ewan@xensource.com> | 2007-02-21 23:03:00 +0000 |
commit | b0a0faf30a762700fb51d1ac9f7aa28624797151 (patch) | |
tree | c8838e51b7e79796633cb29a42cfd5ccfcf6f97d /tools/libxen | |
parent | 159ce02013e3d50d3f54ce16e9ceb3bb0164b7c8 (diff) | |
download | xen-b0a0faf30a762700fb51d1ac9f7aa28624797151.tar.gz xen-b0a0faf30a762700fb51d1ac9f7aa28624797151.tar.bz2 xen-b0a0faf30a762700fb51d1ac9f7aa28624797151.zip |
Added VBD. and VIF.qos_supported_algorithms fields, with C bindings, Xend
implementation to follow.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen')
-rw-r--r-- | tools/libxen/include/xen_vbd.h | 9 | ||||
-rw-r--r-- | tools/libxen/include/xen_vif.h | 9 | ||||
-rw-r--r-- | tools/libxen/src/xen_vbd.c | 21 | ||||
-rw-r--r-- | tools/libxen/src/xen_vif.c | 21 |
4 files changed, 60 insertions, 0 deletions
diff --git a/tools/libxen/include/xen_vbd.h b/tools/libxen/include/xen_vbd.h index 543a42288c..8489887605 100644 --- a/tools/libxen/include/xen_vbd.h +++ b/tools/libxen/include/xen_vbd.h @@ -20,6 +20,7 @@ #define XEN_VBD_H #include "xen_common.h" +#include "xen_string_set.h" #include "xen_string_string_map.h" #include "xen_vbd_decl.h" #include "xen_vbd_metrics_decl.h" @@ -77,6 +78,7 @@ typedef struct xen_vbd_record enum xen_vbd_type type; char *qos_algorithm_type; xen_string_string_map *qos_algorithm_params; + struct xen_string_set *qos_supported_algorithms; struct xen_vbd_metrics_record_opt *metrics; } xen_vbd_record; @@ -251,6 +253,13 @@ xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **r /** + * Get the qos/supported_algorithms field of the given VBD. + */ +extern bool +xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd); + + +/** * Get the metrics field of the given VBD. */ extern bool diff --git a/tools/libxen/include/xen_vif.h b/tools/libxen/include/xen_vif.h index c6ec71ee03..bf1ea1e23b 100644 --- a/tools/libxen/include/xen_vif.h +++ b/tools/libxen/include/xen_vif.h @@ -21,6 +21,7 @@ #include "xen_common.h" #include "xen_network_decl.h" +#include "xen_string_set.h" #include "xen_string_string_map.h" #include "xen_vif_decl.h" #include "xen_vif_metrics_decl.h" @@ -73,6 +74,7 @@ typedef struct xen_vif_record int64_t mtu; char *qos_algorithm_type; xen_string_string_map *qos_algorithm_params; + struct xen_string_set *qos_supported_algorithms; struct xen_vif_metrics_record_opt *metrics; } xen_vif_record; @@ -240,6 +242,13 @@ xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **r /** + * Get the qos/supported_algorithms field of the given VIF. + */ +extern bool +xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif); + + +/** * Get the metrics field of the given VIF. */ extern bool diff --git a/tools/libxen/src/xen_vbd.c b/tools/libxen/src/xen_vbd.c index 5e0b14dfbb..d050ff2784 100644 --- a/tools/libxen/src/xen_vbd.c +++ b/tools/libxen/src/xen_vbd.c @@ -72,6 +72,9 @@ static const struct_member xen_vbd_record_struct_members[] = { .key = "qos_algorithm_params", .type = &abstract_type_string_string_map, .offset = offsetof(xen_vbd_record, qos_algorithm_params) }, + { .key = "qos_supported_algorithms", + .type = &abstract_type_string_set, + .offset = offsetof(xen_vbd_record, qos_supported_algorithms) }, { .key = "metrics", .type = &abstract_type_ref, .offset = offsetof(xen_vbd_record, metrics) } @@ -101,6 +104,7 @@ xen_vbd_record_free(xen_vbd_record *record) free(record->device); free(record->qos_algorithm_type); xen_string_string_map_free(record->qos_algorithm_params); + xen_string_set_free(record->qos_supported_algorithms); xen_vbd_metrics_record_opt_free(record->metrics); free(record); } @@ -309,6 +313,23 @@ xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **r bool +xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vbd } + }; + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + XEN_CALL_("VBD.get_qos_supported_algorithms"); + return session->ok; +} + + +bool xen_vbd_get_metrics(xen_session *session, xen_vbd_metrics *result, xen_vbd vbd) { abstract_value param_values[] = diff --git a/tools/libxen/src/xen_vif.c b/tools/libxen/src/xen_vif.c index 62a6ef16a2..3d7d2ad171 100644 --- a/tools/libxen/src/xen_vif.c +++ b/tools/libxen/src/xen_vif.c @@ -64,6 +64,9 @@ static const struct_member xen_vif_record_struct_members[] = { .key = "qos_algorithm_params", .type = &abstract_type_string_string_map, .offset = offsetof(xen_vif_record, qos_algorithm_params) }, + { .key = "qos_supported_algorithms", + .type = &abstract_type_string_set, + .offset = offsetof(xen_vif_record, qos_supported_algorithms) }, { .key = "metrics", .type = &abstract_type_ref, .offset = offsetof(xen_vif_record, metrics) } @@ -94,6 +97,7 @@ xen_vif_record_free(xen_vif_record *record) free(record->mac); free(record->qos_algorithm_type); xen_string_string_map_free(record->qos_algorithm_params); + xen_string_set_free(record->qos_supported_algorithms); xen_vif_metrics_record_opt_free(record->metrics); free(record); } @@ -289,6 +293,23 @@ xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **r bool +xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vif } + }; + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + XEN_CALL_("VIF.get_qos_supported_algorithms"); + return session->ok; +} + + +bool xen_vif_get_metrics(xen_session *session, xen_vif_metrics *result, xen_vif vif) { abstract_value param_values[] = |