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

Re: [Xen-devel] [PATCH v4 --for 4.6 COLOPre 15/25] tools/libxl: check QEMU state before resume dm





On 07/16/2015 10:43 PM, Wei Liu wrote:
On Wed, Jul 15, 2015 at 03:45:41PM +0800, Yang Hongyang wrote:
check QEMU state before resume dm on QEMU_XEN_TRADITIONAL.

Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>

I think it was me who suggested this and this patch looks correct.

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

Thanks!


---
  tools/libxl/libxl_dom_suspend.c | 13 +++++++++++--
  1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
index 6f04c26..686a49b 100644
--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -434,11 +434,20 @@ static void 
domain_suspend_callback_common_done(libxl__egc *egc,

  int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
  {
+    char *path;
+    char *state;

      switch (libxl__device_model_version_running(gc, domid)) {
      case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: {
-        libxl__qemu_traditional_cmd(gc, domid, "continue");
-        libxl__wait_for_device_model_deprecated(gc, domid, "running", NULL, 
NULL, NULL);
+        uint32_t dm_domid = libxl_get_stubdom_id(CTX, domid);
+
+        path = libxl__device_model_xs_path(gc, dm_domid, domid, "/state");
+        state = libxl__xs_read(gc, XBT_NULL, path);
+        if (state != NULL && !strcmp(state, "paused")) {
+            libxl__qemu_traditional_cmd(gc, domid, "continue");
+            libxl__wait_for_device_model_deprecated(gc, domid, "running",
+                                                    NULL, NULL, NULL);
+        }
          break;
      }
      case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
--
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
.


--
Thanks,
Yang.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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