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

RE: [Xen-devel] [PATCH V4] Clear device-model information when destroyin

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH V4] Clear device-model information when destroying an HVM domain with stubdom-v3
From: "Jun Zhu (Intern)" <Jun.Zhu@xxxxxxxxxx>
Date: Tue, 14 Sep 2010 15:37:48 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Tue, 14 Sep 2010 07:41:28 -0700
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
Thread-index: AQHLVBqSTf4h906CakCM6sQPMUEbiQ==
Thread-topic: [Xen-devel] [PATCH V4] Clear device-model information when destroying an HVM domain with stubdom-v3
 Clear device-model information when destroying an HVM domain with stubdom-v4.

# HG changeset patch
# User Jun Zhu <Jun.Zhu@xxxxxxxxxx>
# Date 1284474545 -3600
# Node ID 3ce8a7f5a56d44e4ecef5ccd8ab54813d0cfb9bf
# Parent  65010d314adb1efe0674b2c1e7337affc6dbe57b
Clear device-model information when destroying an HVM domain with stubdom

diff -r 65010d314adb -r 3ce8a7f5a56d tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon Sep 13 17:48:19 2010 +0100
+++ b/tools/libxl/libxl.c       Tue Sep 14 15:29:05 2010 +0100
@@ -899,21 +899,26 @@
         }
         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;


Jun Zhu
Citrix Systems UK
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • RE: [Xen-devel] [PATCH V4] Clear device-model information when destroying an HVM domain with stubdom-v3, Jun Zhu (Intern) <=