All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xenproject.org
Cc: "Anthony PERARD" <anthony.perard@citrix.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v5] libxl: fix migration of PV and PVH domUs with and without qemu
Date: Tue, 14 May 2019 10:14:52 +0200	[thread overview]
Message-ID: <20190514101452.10c40b6e.olaf@aepfle.de> (raw)
In-Reply-To: <20190514080558.14540-1-olaf@aepfle.de>


[-- Attachment #1.1: Type: text/plain, Size: 2044 bytes --]

Am Tue, 14 May 2019 10:05:58 +0200
schrieb Olaf Hering <olaf@aepfle.de>:

> @@ -459,7 +461,9 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
>          goto out;
>      }
>  
> -    if (type == LIBXL_DOMAIN_TYPE_HVM) {
> +    if (type == LIBXL_DOMAIN_TYPE_HVM ||
> +        libxl__device_model_version_running(gc, domid) ==
> +        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
>          rc = libxl__domain_resume_device_model(gc, domid);
>          if (rc) {
>              LOGD(ERROR, domid, "failed to resume device model:%d", rc);

I think this could be done like that instead, so that libxl__device_model_version_running
is called just once:

--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -444,6 +444,8 @@ int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
         if (libxl__qmp_resume(gc, domid))
             return ERROR_FAIL;
         break;
+    case LIBXL_DEVICE_MODEL_VERSION_NONE:
+        break;
     default:
         return ERROR_INVAL;
     }
@@ -461,14 +463,10 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
         goto out;
     }
 
-    if (type == LIBXL_DOMAIN_TYPE_HVM ||
-        libxl__device_model_version_running(gc, domid) ==
-        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
-        rc = libxl__domain_resume_device_model(gc, domid);
-        if (rc) {
-            LOGD(ERROR, domid, "failed to resume device model:%d", rc);
-            goto out;
-        }
+    rc = libxl__domain_resume_device_model(gc, domid);
+    if (rc) {
+        LOGD(ERROR, domid, "failed to resume device model:%d", rc);
+        goto out;
     }
 
     if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) {


While it is easy for the resume path, doing the same in the suspend path
needs more changes. libxl__domain_suspend_device_model would need to receive
the callback and set it if a device model is active.

Should this be done on top of this change?

Olaf

[-- Attachment #1.2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

WARNING: multiple messages have this Message-ID (diff)
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xenproject.org
Cc: "Anthony PERARD" <anthony.perard@citrix.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v5] libxl: fix migration of PV and PVH domUs with and without qemu
Date: Tue, 14 May 2019 10:14:52 +0200	[thread overview]
Message-ID: <20190514101452.10c40b6e.olaf@aepfle.de> (raw)
Message-ID: <20190514081452.Cq9w59YseYR0oFuTsjAdQ56lw2Mi53AWFNxJ7etkpaI@z> (raw)
In-Reply-To: <20190514080558.14540-1-olaf@aepfle.de>


[-- Attachment #1.1: Type: text/plain, Size: 2044 bytes --]

Am Tue, 14 May 2019 10:05:58 +0200
schrieb Olaf Hering <olaf@aepfle.de>:

> @@ -459,7 +461,9 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
>          goto out;
>      }
>  
> -    if (type == LIBXL_DOMAIN_TYPE_HVM) {
> +    if (type == LIBXL_DOMAIN_TYPE_HVM ||
> +        libxl__device_model_version_running(gc, domid) ==
> +        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
>          rc = libxl__domain_resume_device_model(gc, domid);
>          if (rc) {
>              LOGD(ERROR, domid, "failed to resume device model:%d", rc);

I think this could be done like that instead, so that libxl__device_model_version_running
is called just once:

--- a/tools/libxl/libxl_dom_suspend.c
+++ b/tools/libxl/libxl_dom_suspend.c
@@ -444,6 +444,8 @@ int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
         if (libxl__qmp_resume(gc, domid))
             return ERROR_FAIL;
         break;
+    case LIBXL_DEVICE_MODEL_VERSION_NONE:
+        break;
     default:
         return ERROR_INVAL;
     }
@@ -461,14 +463,10 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel)
         goto out;
     }
 
-    if (type == LIBXL_DOMAIN_TYPE_HVM ||
-        libxl__device_model_version_running(gc, domid) ==
-        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
-        rc = libxl__domain_resume_device_model(gc, domid);
-        if (rc) {
-            LOGD(ERROR, domid, "failed to resume device model:%d", rc);
-            goto out;
-        }
+    rc = libxl__domain_resume_device_model(gc, domid);
+    if (rc) {
+        LOGD(ERROR, domid, "failed to resume device model:%d", rc);
+        goto out;
     }
 
     if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) {


While it is easy for the resume path, doing the same in the suspend path
needs more changes. libxl__domain_suspend_device_model would need to receive
the callback and set it if a device model is active.

Should this be done on top of this change?

Olaf

[-- Attachment #1.2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-05-14  8:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14  8:05 [PATCH v5] libxl: fix migration of PV and PVH domUs with and without qemu Olaf Hering
2019-05-14  8:05 ` [Xen-devel] " Olaf Hering
2019-05-14  8:14 ` Olaf Hering [this message]
2019-05-14  8:14   ` Olaf Hering
2019-05-14 14:38   ` Wei Liu
2019-05-14 14:38     ` [Xen-devel] " Wei Liu
2019-05-14 14:44     ` Olaf Hering
2019-05-14 14:44       ` [Xen-devel] " Olaf Hering
2019-05-14 15:42       ` Wei Liu
2019-05-14 15:42         ` [Xen-devel] " Wei Liu
2019-05-14 11:19 ` Roger Pau Monné
2019-05-14 11:19   ` [Xen-devel] " Roger Pau Monné

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=20190514101452.10c40b6e.olaf@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=anthony.perard@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.