aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxen
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2007-02-02 10:25:17 +0000
committerEwan Mellor <ewan@xensource.com>2007-02-02 10:25:17 +0000
commit8389ab43f55c635516235c48ba1d38562a84070c (patch)
tree4b7bc3ae0bacfaa2e4ed288249487b7f070dadab /tools/libxen
parentd650ce4366197c1a7bfd4519f7a60702301f7a27 (diff)
downloadxen-8389ab43f55c635516235c48ba1d38562a84070c.tar.gz
xen-8389ab43f55c635516235c48ba1d38562a84070c.tar.bz2
xen-8389ab43f55c635516235c48ba1d38562a84070c.zip
Added host.dmesg method.
Also, fixed all of the host methods, which had been broken by the introduction of the host_metrics class. Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen')
-rw-r--r--tools/libxen/include/xen_host.h7
-rw-r--r--tools/libxen/src/xen_host.c17
-rw-r--r--tools/libxen/test/test_bindings.c17
3 files changed, 41 insertions, 0 deletions
diff --git a/tools/libxen/include/xen_host.h b/tools/libxen/include/xen_host.h
index e64390b89f..26ca29d592 100644
--- a/tools/libxen/include/xen_host.h
+++ b/tools/libxen/include/xen_host.h
@@ -394,6 +394,13 @@ xen_host_reboot(xen_session *session, xen_host host);
/**
+ * Get the host xen dmesg.
+ */
+extern bool
+xen_host_dmesg(xen_session *session, char **result, xen_host host);
+
+
+/**
* Return a list of all the hosts known to the system.
*/
extern bool
diff --git a/tools/libxen/src/xen_host.c b/tools/libxen/src/xen_host.c
index 7968b96994..4a79daa90f 100644
--- a/tools/libxen/src/xen_host.c
+++ b/tools/libxen/src/xen_host.c
@@ -632,6 +632,23 @@ xen_host_reboot(xen_session *session, xen_host host)
bool
+xen_host_dmesg(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.dmesg");
+ return session->ok;
+}
+
+
+bool
xen_host_get_all(xen_session *session, struct xen_host_set **result)
{
diff --git a/tools/libxen/test/test_bindings.c b/tools/libxen/test/test_bindings.c
index 8ce02377b1..c1df98dcea 100644
--- a/tools/libxen/test/test_bindings.c
+++ b/tools/libxen/test/test_bindings.c
@@ -206,6 +206,20 @@ int main(int argc, char **argv)
return 1;
}
+ char *dmesg;
+ if (!xen_host_dmesg(session, &dmesg, host))
+ {
+ print_error(session);
+ xen_string_string_map_free(versions);
+ xen_host_free(host);
+ xen_vm_record_free(vm_record);
+ xen_uuid_bytes_free(vm_uuid_bytes);
+ xen_uuid_free(vm_uuid);
+ xen_vm_free(vm);
+ CLEANUP;
+ return 1;
+ }
+
printf("%s.\n", vm_uuid);
fprintf(stderr, "In bytes, the VM UUID is ");
@@ -223,6 +237,8 @@ int main(int argc, char **argv)
versions->contents[i].val);
}
+ printf("Host dmesg follows:\n%s\n\n", dmesg);
+
printf("%s.\n", vm_record->uuid);
printf("Resident on %s.\n", (char *)vm_record->resident_on->u.handle);
@@ -244,6 +260,7 @@ int main(int argc, char **argv)
xen_host_free(host);
xen_string_string_map_free(versions);
+ free(dmesg);
xen_vm new_vm = create_new_vm(session, true);