diff options
author | Ewan Mellor <ewan@xensource.com> | 2007-02-25 17:20:51 +0000 |
---|---|---|
committer | Ewan Mellor <ewan@xensource.com> | 2007-02-25 17:20:51 +0000 |
commit | 5baa3458c54ea77ce40bf9148b7a99425810d62a (patch) | |
tree | f92aa8a71ee63ec37e6b83d803c8e8421a683d82 /tools/libxen | |
parent | b0a0faf30a762700fb51d1ac9f7aa28624797151 (diff) | |
download | xen-5baa3458c54ea77ce40bf9148b7a99425810d62a.tar.gz xen-5baa3458c54ea77ce40bf9148b7a99425810d62a.tar.bz2 xen-5baa3458c54ea77ce40bf9148b7a99425810d62a.zip |
Added host.API_version_{major,minor,vendor,vendor_implementation} fields.
Fix missing host.other_config from the record returned by Xend.
Improve the error diagnosis when we catch TypeError.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen')
-rw-r--r-- | tools/libxen/include/xen_host.h | 32 | ||||
-rw-r--r-- | tools/libxen/src/xen_host.c | 80 |
2 files changed, 112 insertions, 0 deletions
diff --git a/tools/libxen/include/xen_host.h b/tools/libxen/include/xen_host.h index 568973a464..8f84dc37ad 100644 --- a/tools/libxen/include/xen_host.h +++ b/tools/libxen/include/xen_host.h @@ -72,6 +72,10 @@ typedef struct xen_host_record char *uuid; char *name_label; char *name_description; + int64_t api_version_major; + int64_t api_version_minor; + char *api_version_vendor; + xen_string_string_map *api_version_vendor_implementation; xen_string_string_map *software_version; xen_string_string_map *other_config; struct xen_string_set *supported_bootloaders; @@ -207,6 +211,34 @@ xen_host_get_name_description(xen_session *session, char **result, xen_host host /** + * Get the API_version/major field of the given host. + */ +extern bool +xen_host_get_api_version_major(xen_session *session, int64_t *result, xen_host host); + + +/** + * Get the API_version/minor field of the given host. + */ +extern bool +xen_host_get_api_version_minor(xen_session *session, int64_t *result, xen_host host); + + +/** + * Get the API_version/vendor field of the given host. + */ +extern bool +xen_host_get_api_version_vendor(xen_session *session, char **result, xen_host host); + + +/** + * Get the API_version/vendor_implementation field of the given host. + */ +extern bool +xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host); + + +/** * Get the software_version field of the given host. */ extern bool diff --git a/tools/libxen/src/xen_host.c b/tools/libxen/src/xen_host.c index 24cc4140cc..04b8452e5d 100644 --- a/tools/libxen/src/xen_host.c +++ b/tools/libxen/src/xen_host.c @@ -52,6 +52,18 @@ static const struct_member xen_host_record_struct_members[] = { .key = "name_description", .type = &abstract_type_string, .offset = offsetof(xen_host_record, name_description) }, + { .key = "API_version_major", + .type = &abstract_type_int, + .offset = offsetof(xen_host_record, api_version_major) }, + { .key = "API_version_minor", + .type = &abstract_type_int, + .offset = offsetof(xen_host_record, api_version_minor) }, + { .key = "API_version_vendor", + .type = &abstract_type_string, + .offset = offsetof(xen_host_record, api_version_vendor) }, + { .key = "API_version_vendor_implementation", + .type = &abstract_type_string_string_map, + .offset = offsetof(xen_host_record, api_version_vendor_implementation) }, { .key = "software_version", .type = &abstract_type_string_string_map, .offset = offsetof(xen_host_record, software_version) }, @@ -108,6 +120,8 @@ xen_host_record_free(xen_host_record *record) free(record->uuid); free(record->name_label); free(record->name_description); + free(record->api_version_vendor); + xen_string_string_map_free(record->api_version_vendor_implementation); xen_string_string_map_free(record->software_version); xen_string_string_map_free(record->other_config); xen_string_set_free(record->supported_bootloaders); @@ -215,6 +229,72 @@ xen_host_get_name_description(xen_session *session, char **result, xen_host host bool +xen_host_get_api_version_major(xen_session *session, int64_t *result, xen_host host) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = host } + }; + + abstract_type result_type = abstract_type_int; + + XEN_CALL_("host.get_API_version_major"); + return session->ok; +} + + +bool +xen_host_get_api_version_minor(xen_session *session, int64_t *result, xen_host host) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = host } + }; + + abstract_type result_type = abstract_type_int; + + XEN_CALL_("host.get_API_version_minor"); + return session->ok; +} + + +bool +xen_host_get_api_version_vendor(xen_session *session, char **result, xen_host host) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = host } + }; + + abstract_type result_type = abstract_type_string; + + *result = NULL; + XEN_CALL_("host.get_API_version_vendor"); + return session->ok; +} + + +bool +xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = host } + }; + + abstract_type result_type = abstract_type_string_string_map; + + *result = NULL; + XEN_CALL_("host.get_API_version_vendor_implementation"); + return session->ok; +} + + +bool xen_host_get_software_version(xen_session *session, xen_string_string_map **result, xen_host host) { abstract_value param_values[] = |