debuggers.hg

changeset 21192:117c79b7066d

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>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 12 17:45:26 2010 +0100 (2010-04-12)
parents be6e58cc2475
children 4405b50cb183
files tools/libxl/libxl_device.c tools/libxl/xl.c
line diff
     1.1 --- a/tools/libxl/libxl_device.c	Mon Apr 12 17:44:47 2010 +0100
     1.2 +++ b/tools/libxl/libxl_device.c	Mon Apr 12 17:45:26 2010 +0100
     1.3 @@ -301,7 +301,7 @@ int libxl_devices_destroy(struct libxl_c
     1.4      if (!l1) {
     1.5          XL_LOG(&clone, XL_LOG_ERROR, "%s is empty", path);
     1.6          libxl_ctx_free(&clone);
     1.7 -        return -1;
     1.8 +        return 0;
     1.9      }
    1.10      for (i = 0; i < num1; i++) {
    1.11          if (!strcmp("vfs", l1[i]))
     2.1 --- a/tools/libxl/xl.c	Mon Apr 12 17:44:47 2010 +0100
     2.2 +++ b/tools/libxl/xl.c	Mon Apr 12 17:45:26 2010 +0100
     2.3 @@ -1277,8 +1277,10 @@ void unpause_domain(char *p)
     2.4  
     2.5  void destroy_domain(char *p)
     2.6  {
     2.7 +    int rc;
     2.8      find_domain(p);
     2.9 -    libxl_domain_destroy(&ctx, domid, 0);
    2.10 +    rc = libxl_domain_destroy(&ctx, domid, 0);
    2.11 +    if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n.",rc); exit(-1); }
    2.12  }
    2.13  
    2.14  void list_domains(int verbose)