From: Andres Lagar-Cavilla <andres@lagarcavilla.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
xen-devel@lists.xensource.com
Subject: [PATCH 07/14]: libxenlight, destroy device-model only for hvm domains
Date: Mon, 30 Nov 2009 14:13:49 -0500 [thread overview]
Message-ID: <4B14196D.8010603@lagarcavilla.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 107 bytes --]
Destroy device-model only for hvm domains.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
[-- Attachment #2: 07_destroy_dm_only_hvm.patch --]
[-- Type: text/x-patch, Size: 1896 bytes --]
# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.com>
# Date 1259253630 18000
# Node ID 05e2dad9b117e80c8daf55a30cb7eeda3fda4764
# Parent a19e1cef7b72a90b3cc9c8c38dadf06aaf413155
Destroy device-model only for hvm domains.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
diff -r a19e1cef7b72 -r 05e2dad9b117 libxl.c
--- a/libxl.c
+++ b/libxl.c
@@ -443,8 +443,9 @@ int libxl_domain_destroy(struct libxl_ct
{
char *dom_path, vm_path[41];
xen_uuid_t *uuid;
- int rc;
+ int rc, hvm;
+ hvm = is_hvm(ctx, domid);
dom_path = libxl_xs_get_dompath(ctx, domid);
if (!dom_path)
return -1;
@@ -455,16 +456,20 @@ int libxl_domain_destroy(struct libxl_ct
}
if (libxl_device_pci_shutdown(ctx, domid) < 0)
XL_LOG(ctx, XL_LOG_ERROR, "pci shutdown failed for domid %d", domid);
- xs_write(ctx->xsh, XBT_NULL,
- libxl_sprintf(ctx, "/local/domain/0/device-model/%d/command", domid),
- "shutdown", strlen("shutdown"));
+ if (hvm) {
+ xs_write(ctx->xsh, XBT_NULL,
+ libxl_sprintf(ctx, "/local/domain/0/device-model/%d/command", domid),
+ "shutdown", strlen("shutdown"));
+ }
rc = xc_domain_pause(ctx->xch, domid);
if (rc < 0) {
XL_LOG_ERRNOVAL(ctx, XL_LOG_ERROR, rc, "xc_domain_pause failed for %d", domid);
return -1;
}
- if (libxl_destroy_device_model(ctx, domid) < 0)
- XL_LOG(ctx, XL_LOG_ERROR, "libxl_destroy_device_model failed for %d", domid);
+ if (hvm) {
+ if (libxl_destroy_device_model(ctx, domid) < 0)
+ XL_LOG(ctx, XL_LOG_ERROR, "libxl_destroy_device_model failed for %d", domid);
+ }
if (libxl_devices_destroy(ctx, domid, force) < 0)
XL_LOG(ctx, XL_LOG_ERROR, "libxl_destroy_devices failed for %d", domid);
if (!xs_rm(ctx->xsh, XBT_NULL, dom_path))
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2009-11-30 19:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-30 19:13 Andres Lagar-Cavilla [this message]
2009-12-01 6:14 ` [PATCH 07/14]: libxenlight, destroy device-model only for hvm domains Vincent Hanquez
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=4B14196D.8010603@lagarcavilla.com \
--to=andres@lagarcavilla.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.