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

[Xen-devel] [PATCH 07/14]: libxenlight, destroy device-model only for hv

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 07/14]: libxenlight, destroy device-model only for hvm domains
From: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Date: Mon, 30 Nov 2009 14:13:49 -0500
Cc:
Delivery-date: Mon, 30 Nov 2009 11:15:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Destroy device-model only for hvm domains.

Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>

# HG changeset patch
# User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
# Date 1259253630 18000
# Node ID 05e2dad9b117e80c8daf55a30cb7eeda3fda4764
# Parent  a19e1cef7b72a90b3cc9c8c38dadf06aaf413155
Destroy device-model only for hvm domains.

Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>

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))
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>