Mailing List Archive

[xen-unstable] libxl, xl: Fix two minor bugs in domain destruction
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1271090726 -3600
# Node ID 117c79b7066d0477df09a784fbf37be371ce93aa
# Parent be6e58cc247554057aca710ed8b373911b0b65d3
libxl,xl: Fix two minor bugs in domain destruction

* 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@eu.citrix.com>
---
tools/libxl/libxl_device.c | 2 +-
tools/libxl/xl.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff -r be6e58cc2475 -r 117c79b7066d tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c Mon Apr 12 17:44:47 2010 +0100
+++ b/tools/libxl/libxl_device.c Mon Apr 12 17:45:26 2010 +0100
@@ -301,7 +301,7 @@ int libxl_devices_destroy(struct libxl_c
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 -r be6e58cc2475 -r 117c79b7066d tools/libxl/xl.c
--- a/tools/libxl/xl.c Mon Apr 12 17:44:47 2010 +0100
+++ b/tools/libxl/xl.c Mon Apr 12 17:45:26 2010 +0100
@@ -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)

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