Add support for VM.destroy RPC in libxen.
authorjfehlig@jfehlig2.provo.novell.com <jfehlig@jfehlig2.provo.novell.com>
Wed, 8 Nov 2006 01:14:16 +0000 (18:14 -0700)
committerjfehlig@jfehlig2.provo.novell.com <jfehlig@jfehlig2.provo.novell.com>
Wed, 8 Nov 2006 01:14:16 +0000 (18:14 -0700)
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
tools/libxen/include/xen_vm.h
tools/libxen/src/xen_vm.c

index 7fe5d7747ba4f4c9dd5ba80428f00ad82b9239a0..b1ff2e812e2f8f8eb9da4e03696ded56892fb376 100644 (file)
@@ -799,4 +799,12 @@ extern bool
 xen_vm_get_all(xen_session *session, struct xen_vm_set **result);
 
 
+/**
+ * Destroy the specified VM.  The VM is completely removed from the system.
+ * This function can only be called when the VM is in the Halted State.
+ */
+extern bool
+xen_vm_destroy(xen_session *session, xen_vm vm);
+
+
 #endif
index 8915be204b30b6c09905495b1c1735ab653c7909..d55b07c3a96a2bc7c95303f233e74f9e47497dc1 100644 (file)
@@ -1580,3 +1580,17 @@ xen_vm_get_uuid(xen_session *session, char **result, xen_vm vm)
     *result = session->ok ? xen_strdup_((char *)vm) : NULL;
     return session->ok;
 }
+
+
+bool
+xen_vm_destroy(xen_session *session, xen_vm vm)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm }
+        };
+
+    xen_call_(session, "VM.destroy", param_values, 1, NULL, NULL);
+    return session->ok;
+}