diff options
author | Ewan Mellor <ewan@xensource.com> | 2007-04-10 17:29:16 +0100 |
---|---|---|
committer | Ewan Mellor <ewan@xensource.com> | 2007-04-10 17:29:16 +0100 |
commit | 9853a49dd9feb3180ecfa9b9b5c3339af8f3442c (patch) | |
tree | 73748657cd883775dcda67f70b641817dfe2e5ef /tools/libxen | |
parent | eb0639b38e60d4563cd2d49df2ca940ce1768a53 (diff) | |
download | xen-9853a49dd9feb3180ecfa9b9b5c3339af8f3442c.tar.gz xen-9853a49dd9feb3180ecfa9b9b5c3339af8f3442c.tar.bz2 xen-9853a49dd9feb3180ecfa9b9b5c3339af8f3442c.zip |
Added docs and bindings for VM.{send_trigger,send_sysrq}.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen')
-rw-r--r-- | tools/libxen/include/xen_vm.h | 17 | ||||
-rw-r--r-- | tools/libxen/src/xen_vm.c | 32 |
2 files changed, 49 insertions, 0 deletions
diff --git a/tools/libxen/include/xen_vm.h b/tools/libxen/include/xen_vm.h index 4b338088df..0f5c440c16 100644 --- a/tools/libxen/include/xen_vm.h +++ b/tools/libxen/include/xen_vm.h @@ -838,6 +838,23 @@ xen_vm_set_vcpus_number_live(xen_session *session, xen_vm self, int64_t nvcpu); /** + * Send the given key as a sysrq to this VM. The key is specified as a + * single character (a String of length 1). This can only be called when the + * specified VM is in the Running state. + */ +extern bool +xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key); + + +/** + * Send the named trigger to this VM. This can only be called when the + * specified VM is in the Running state. + */ +extern bool +xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger); + + +/** * Return a list of all the VMs known to the system. */ extern bool diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c index c0ac17c9d5..5f5aa72b9a 100644 --- a/tools/libxen/src/xen_vm.c +++ b/tools/libxen/src/xen_vm.c @@ -1610,6 +1610,38 @@ xen_vm_set_vcpus_number_live(xen_session *session, xen_vm self, int64_t nvcpu) bool +xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vm }, + { .type = &abstract_type_string, + .u.string_val = key } + }; + + xen_call_(session, "VM.send_sysrq", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool +xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vm }, + { .type = &abstract_type_string, + .u.string_val = trigger } + }; + + xen_call_(session, "VM.send_trigger", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool xen_vm_get_all(xen_session *session, struct xen_vm_set **result) { |