[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] [PATCH V4] Clear device-model information when destroying an HVM domain with stubdom-v3


  • To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.