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-changelog

[Xen-changelog] [xen-unstable] libxenlight: don't try to delete path whe

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxenlight: don't try to delete path when they doesn't exists.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 08 Jan 2010 04:00:40 -0800
Delivery-date: Fri, 08 Jan 2010 04:01:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1262951282 0
# Node ID b35974051d7e6b41b0f829452306d9eb45340dd2
# Parent  9a49e6a66bf0572d003ff68c621a8e7c04008171
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@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff -r 9a49e6a66bf0 -r b35974051d7e tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Fri Jan 08 11:47:28 2010 +0000
+++ b/tools/libxl/libxl.c       Fri Jan 08 11:48:02 2010 +0000
@@ -564,16 +564,19 @@ int libxl_domain_destroy(struct libxl_ct
         XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", dom_path);
 
     vm_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, 
"/local/domain/%d/vm", domid));
-    if (!xs_rm(ctx->xsh, XBT_NULL, vm_path))
-        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vm_path);
+    if (vm_path)
+        if (!xs_rm(ctx->xsh, XBT_NULL, vm_path))
+            XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vm_path);
 
     vss_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, 
"/local/domain/%d/vss", domid));
-    if (!xs_rm(ctx->xsh, XBT_NULL, vss_path))
-        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vss_path);
+    if (vss_path)
+        if (!xs_rm(ctx->xsh, XBT_NULL, vss_path))
+            XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", vss_path);
 
     xapi_path = libxl_sprintf(ctx, "/xapi/%u", domid);
-    if (!xs_rm(ctx->xsh, XBT_NULL, xapi_path))
-        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", xapi_path);
+    if (xapi_path)
+        if (!xs_rm(ctx->xsh, XBT_NULL, xapi_path))
+            XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", xapi_path);
 
     rc = xc_domain_destroy(ctx->xch, domid);
     if (rc < 0) {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxenlight: don't try to delete path when they doesn't exists., Xen patchbot-unstable <=