From f01fa26a0f4b16f0b296d30463f77f57974996dc Mon Sep 17 00:00:00 2001 From: "ewan@localhost.localdomain" Date: Mon, 16 Apr 2007 16:10:39 -0400 Subject: Added host.enabled flag. Signed-off-by: Ewan Mellor --- tools/libxen/include/xen_host.h | 8 ++++++++ tools/libxen/src/xen_host.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) (limited to 'tools/libxen') diff --git a/tools/libxen/include/xen_host.h b/tools/libxen/include/xen_host.h index 181aa5e22d..cb2c447fc4 100644 --- a/tools/libxen/include/xen_host.h +++ b/tools/libxen/include/xen_host.h @@ -76,6 +76,7 @@ typedef struct xen_host_record int64_t api_version_minor; char *api_version_vendor; xen_string_string_map *api_version_vendor_implementation; + bool enabled; xen_string_string_map *software_version; xen_string_string_map *other_config; struct xen_string_set *capabilities; @@ -241,6 +242,13 @@ extern bool xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host); +/** + * Get the enabled field of the given host. + */ +extern bool +xen_host_get_enabled(xen_session *session, bool *result, xen_host host); + + /** * Get the software_version field of the given host. */ diff --git a/tools/libxen/src/xen_host.c b/tools/libxen/src/xen_host.c index bc2b1f0e8b..331ed2105b 100644 --- a/tools/libxen/src/xen_host.c +++ b/tools/libxen/src/xen_host.c @@ -64,6 +64,9 @@ static const struct_member xen_host_record_struct_members[] = { .key = "API_version_vendor_implementation", .type = &abstract_type_string_string_map, .offset = offsetof(xen_host_record, api_version_vendor_implementation) }, + { .key = "enabled", + .type = &abstract_type_bool, + .offset = offsetof(xen_host_record, enabled) }, { .key = "software_version", .type = &abstract_type_string_string_map, .offset = offsetof(xen_host_record, software_version) }, @@ -306,6 +309,22 @@ xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_ } +bool +xen_host_get_enabled(xen_session *session, bool *result, xen_host host) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = host } + }; + + abstract_type result_type = abstract_type_bool; + + XEN_CALL_("host.get_enabled"); + return session->ok; +} + + bool xen_host_get_software_version(xen_session *session, xen_string_string_map **result, xen_host host) { -- cgit v1.2.3