WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][libxen] Add support for VM.destroy

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][libxen] Add support for VM.destroy
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Tue, 07 Nov 2006 18:21:22 -0700
Delivery-date: Tue, 07 Nov 2006 17:23:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.7 (X11/20060909)
This patch adds support for the VM.destroy RPC in libxen. I have successfully used it with a patched xend (XendDomain.py specifically), but am not all that happy with that patch in its current form. The xend patch will follow after some rework and further testing.

Regards,
Jim
# HG changeset patch
# User jfehlig@xxxxxxxxxxxxxxxxxxxxxxxxx
# Date 1162948456 25200
# Node ID 470f439f3f944426d070017e4af333059553c10e
# Parent  8d0e06c38c0ccfb2b106f19fd74f4c144bc86166
Add support for VM.destroy RPC in libxen.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>

diff -r 8d0e06c38c0c -r 470f439f3f94 tools/libxen/include/xen_vm.h
--- a/tools/libxen/include/xen_vm.h     Wed Nov 08 00:03:11 2006 +0000
+++ b/tools/libxen/include/xen_vm.h     Tue Nov 07 18:14:16 2006 -0700
@@ -799,4 +799,12 @@ xen_vm_get_all(xen_session *session, str
 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
diff -r 8d0e06c38c0c -r 470f439f3f94 tools/libxen/src/xen_vm.c
--- a/tools/libxen/src/xen_vm.c Wed Nov 08 00:03:11 2006 +0000
+++ b/tools/libxen/src/xen_vm.c Tue Nov 07 18:14:16 2006 -0700
@@ -1580,3 +1580,17 @@ xen_vm_get_uuid(xen_session *session, ch
     *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;
+}
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>