debuggers.hg

changeset 20823:b35974051d7e

libxenlight: don't try to delete path when they doesn't exists.

fix segfault in destroy when creation hasn't been done properly.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jan 08 11:48:02 2010 +0000 (2010-01-08)
parents 9a49e6a66bf0
children 182883d9acbe
files tools/libxl/libxl.c
line diff
     1.1 --- a/tools/libxl/libxl.c	Fri Jan 08 11:47:28 2010 +0000
     1.2 +++ b/tools/libxl/libxl.c	Fri Jan 08 11:48:02 2010 +0000
     1.3 @@ -564,16 +564,19 @@ int libxl_domain_destroy(struct libxl_ct
     1.4          XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", dom_path);
     1.5  
     1.6      vm_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "/local/domain/%d/vm", domid));
     1.7 -    if (!xs_rm(ctx->xsh, XBT_NULL, vm_path))
     1.8 -        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vm_path);
     1.9 +    if (vm_path)
    1.10 +        if (!xs_rm(ctx->xsh, XBT_NULL, vm_path))
    1.11 +            XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vm_path);
    1.12  
    1.13      vss_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "/local/domain/%d/vss", domid));
    1.14 -    if (!xs_rm(ctx->xsh, XBT_NULL, vss_path))
    1.15 -        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vss_path);
    1.16 +    if (vss_path)
    1.17 +        if (!xs_rm(ctx->xsh, XBT_NULL, vss_path))
    1.18 +            XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vss_path);
    1.19  
    1.20      xapi_path = libxl_sprintf(ctx, "/xapi/%u", domid);
    1.21 -    if (!xs_rm(ctx->xsh, XBT_NULL, xapi_path))
    1.22 -        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", xapi_path);
    1.23 +    if (xapi_path)
    1.24 +        if (!xs_rm(ctx->xsh, XBT_NULL, xapi_path))
    1.25 +            XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", xapi_path);
    1.26  
    1.27      rc = xc_domain_destroy(ctx->xch, domid);
    1.28      if (rc < 0) {