From 8426955edc2723b1288f1f7a9e944ebe42e154f2 Mon Sep 17 00:00:00 2001 From: "ewan@localhost.localdomain" Date: Mon, 16 Apr 2007 16:12:33 -0400 Subject: Added documentation and C bindings for VM.migrate call. Signed-off-by: Ewan Mellor --- tools/libxen/include/xen_vm.h | 8 ++++++++ tools/libxen/src/xen_vm.c | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'tools/libxen') diff --git a/tools/libxen/include/xen_vm.h b/tools/libxen/include/xen_vm.h index 54abe1ba82..d33f31b860 100644 --- a/tools/libxen/include/xen_vm.h +++ b/tools/libxen/include/xen_vm.h @@ -876,6 +876,14 @@ extern bool xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger); +/** + * Migrate the VM to another host. This can only be called when the + * specified VM is in the Running state. + */ +extern bool +xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options); + + /** * Return a list of all the VMs known to the system. */ diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c index 6f88a9239a..d2a4309a0d 100644 --- a/tools/libxen/src/xen_vm.c +++ b/tools/libxen/src/xen_vm.c @@ -1691,6 +1691,26 @@ xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger) } +bool +xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vm }, + { .type = &abstract_type_string, + .u.string_val = dest }, + { .type = &abstract_type_bool, + .u.bool_val = live }, + { .type = &abstract_type_string_string_map, + .u.set_val = (arbitrary_set *)options } + }; + + xen_call_(session, "VM.migrate", param_values, 4, NULL, NULL); + return session->ok; +} + + bool xen_vm_get_all(xen_session *session, struct xen_vm_set **result) { -- cgit v1.2.3