aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxen
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2007-02-25 22:47:29 +0000
committerEwan Mellor <ewan@xensource.com>2007-02-25 22:47:29 +0000
commit719e521fa2c52c1546d007702ed5869d67a33582 (patch)
tree8d8e5cbc152fc34858e66aa36ee030160202a85b /tools/libxen
parent94217354536e8136e0c048809d199af2ff999d06 (diff)
downloadxen-719e521fa2c52c1546d007702ed5869d67a33582.tar.gz
xen-719e521fa2c52c1546d007702ed5869d67a33582.tar.bz2
xen-719e521fa2c52c1546d007702ed5869d67a33582.zip
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>
Diffstat (limited to 'tools/libxen')
-rw-r--r--tools/libxen/include/xen_vbd.h24
-rw-r--r--tools/libxen/include/xen_vif.h24
-rw-r--r--tools/libxen/src/xen_vbd.c59
-rw-r--r--tools/libxen/src/xen_vif.c59
4 files changed, 166 insertions, 0 deletions
diff --git a/tools/libxen/include/xen_vbd.h b/tools/libxen/include/xen_vbd.h
index 8489887605..e3cd7e4500 100644
--- a/tools/libxen/include/xen_vbd.h
+++ b/tools/libxen/include/xen_vbd.h
@@ -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, enum xen_vbd_type *result, xen_vbd vbd);
/**
+ * 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 --git a/tools/libxen/include/xen_vif.h b/tools/libxen/include/xen_vif.h
index bf1ea1e23b..6ef2ebdbea 100644
--- a/tools/libxen/include/xen_vif.h
+++ b/tools/libxen/include/xen_vif.h
@@ -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, int64_t *result, xen_vif vif);
/**
+ * 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 --git a/tools/libxen/src/xen_vbd.c b/tools/libxen/src/xen_vbd.c
index d050ff2784..4d396b88f7 100644
--- a/tools/libxen/src/xen_vbd.c
+++ b/tools/libxen/src/xen_vbd.c
@@ -66,6 +66,15 @@ static const struct_member xen_vbd_record_struct_members[] =
{ .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 *record)
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, enum xen_vbd_type *result, xen_vbd vbd)
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 --git a/tools/libxen/src/xen_vif.c b/tools/libxen/src/xen_vif.c
index 3d7d2ad171..74d67ea9d4 100644
--- a/tools/libxen/src/xen_vif.c
+++ b/tools/libxen/src/xen_vif.c
@@ -58,6 +58,15 @@ static const struct_member xen_vif_record_struct_members[] =
{ .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 *record)
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, int64_t *result, xen_vif vif)
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[] =