# HG changeset patch
# User Jun Zhu <Jun.Zhu@xxxxxxxxxx>
# Date 1284655783 -3600
# Node ID ea47cb5d5755ee18e432db2ba603fc2e64f7e086
# Parent a8026ce8fa38dad024f2be03808c620f90545739
libxl: Clear device-model info when destroying an HVM domain with stubdom.
Signed-off-by: Jun Zhu <Jun.Zhu@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
tools/libxl/libxl.c | 28 ++++++++++++++++------------
1 files changed, 16 insertions(+), 12 deletions(-)
diff -r a8026ce8fa38 -r ea47cb5d5755 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Thu Sep 16 17:39:33 2010 +0100
+++ b/tools/libxl/libxl.c Thu Sep 16 17:49:43 2010 +0100
@@ -899,21 +899,25 @@ static int libxl_destroy_device_model(li
}
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device model is a stubdom,
domid=%d\n", stubdomid);
ret = libxl_domain_destroy(ctx, stubdomid, 0);
- goto out;
+ if (ret)
+ goto out;
+ } else {
+ ret = kill(atoi(pid), SIGHUP);
+ if (ret < 0 && errno == ESRCH) {
+ LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Device Model already exited");
+ ret = 0;
+ } else if (ret == 0) {
+ LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Device Model signaled");
+ ret = 0;
+ } else {
+ LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "failed to kill Device
Model [%d]",
+ atoi(pid));
+ ret = ERROR_FAIL;
+ goto out;
+ }
}
xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(&gc,
"/local/domain/0/device-model/%d", domid));
- ret = kill(atoi(pid), SIGHUP);
- if (ret < 0 && errno == ESRCH) {
- LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Device Model already exited");
- ret = 0;
- } else if (ret == 0) {
- LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Device Model signaled");
- ret = 0;
- } else {
- LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "failed to kill Device Model
[%d]",
- atoi(pid));
- }
out:
libxl__free_all(&gc);
return ret;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|