From: Vincent Hanquez Subject: [PATCH 7/8] don't try to delete path when they doesn't exists. Date: Fri, 8 Jan 2010 11:18:00 +0000 Message-ID: <1262949481-25530-8-git-send-email-vincent.hanquez@eu.citrix.com> References: <1262949481-25530-1-git-send-email-vincent.hanquez@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.6.6" Return-path: In-Reply-To: <1262949481-25530-1-git-send-email-vincent.hanquez@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Vincent Hanquez List-Id: xen-devel@lists.xenproject.org --------------1.6.6 Content-Type: text/plain; charset="UTF-8"; format=fixed Content-Transfer-Encoding: quoted-printable fix segfault in destroy when creation hasn't been done properly. Signed-off-by: Vincent Hanquez --- tools/libxl/libxl.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) --------------1.6.6 Content-Type: text/x-patch; name="0007-don-t-try-to-delete-path-when-they-doesn-t-exists.patch" Content-Disposition: attachment; filename="0007-don-t-try-to-delete-path-when-they-doesn-t-exists.patch" Content-Transfer-Encoding: quoted-printable diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index c5f1fd8..46dcebf 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -564,16 +564,19 @@ int libxl_domain_destroy(struct libxl_ctx *ctx, uin= t32_t domid, int force) XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xs_rm failed for %s", dom_path)= ; =20 vm_path =3D 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_pa= th); =20 vss_path =3D 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_p= ath); =20 xapi_path =3D 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); =20 rc =3D xc_domain_destroy(ctx->xch, domid); if (rc < 0) { --------------1.6.6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------1.6.6--