From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xen.org
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH] libxl: fix dm destruction when there is no pid
Date: Thu, 3 May 2012 13:31:17 +0100 [thread overview]
Message-ID: <1336048277-39554-1-git-send-email-roger.pau@citrix.com> (raw)
Fix qemu dm model destruction if the pid in xenstore is 0 (or is not
present).
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
---
tools/libxl/libxl_dm.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 11de03f..b2bae68 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1081,6 +1081,11 @@ int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid)
pid = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/image/device-model-pid", domid));
if (!pid) {
+ LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't find device model's pid");
+ ret = ERROR_INVAL;
+ goto out;
+ }
+ if (!atoi(pid)) {
int stubdomid = libxl_get_stubdom_id(ctx, domid);
const char *savefile;
@@ -1122,10 +1127,10 @@ int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid)
goto out;
}
}
- xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid));
- xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/hvmloader", domid));
out:
+ xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid));
+ xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/hvmloader", domid));
return ret;
}
--
1.7.7.5 (Apple Git-26)
next reply other threads:[~2012-05-03 12:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 12:31 Roger Pau Monne [this message]
2012-05-04 17:18 ` [PATCH] libxl: fix dm destruction when there is no pid Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336048277-39554-1-git-send-email-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).