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 13/16] libxl, xl: Fix two minor bugs in domain destru

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 13/16] libxl, xl: Fix two minor bugs in domain destruction
From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date: Mon, 12 Apr 2010 15:41:43 +0100
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Delivery-date: Mon, 12 Apr 2010 07:56:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1271083306-11126-13-git-send-email-ian.jackson@xxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1271083306-11126-1-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-2-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-3-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-4-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-5-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-6-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-7-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-8-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-9-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-10-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-11-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-12-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1271083306-11126-13-git-send-email-ian.jackson@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
* If /local/domain/<domid>/device does not exist, this is not
  necessarily an error.  It probably means the domain has been
  partially destroyed already.

* Have xl report errors from libxl_domain_destroy.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_device.c |    2 +-
 tools/libxl/xl.c           |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 9fdd0b4..ca20080 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -301,7 +301,7 @@ int libxl_devices_destroy(struct libxl_ctx *ctx, uint32_t 
domid, int force)
     if (!l1) {
         XL_LOG(&clone, XL_LOG_ERROR, "%s is empty", path);
         libxl_ctx_free(&clone);
-        return -1;
+        return 0;
     }
     for (i = 0; i < num1; i++) {
         if (!strcmp("vfs", l1[i]))
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index fcb4fc4..f1b54e4 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -1277,8 +1277,10 @@ void unpause_domain(char *p)
 
 void destroy_domain(char *p)
 {
+    int rc;
     find_domain(p);
-    libxl_domain_destroy(&ctx, domid, 0);
+    rc = libxl_domain_destroy(&ctx, domid, 0);
+    if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n.",rc); exit(-1); }
 }
 
 void list_domains(int verbose)
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel