xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: "Anthony PERARD" <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Wei Liu" <wei.liu2@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 15:38:55 +0100	[thread overview]
Message-ID: <20190514143855.GH2798@zion.uk.xensource.com> (raw)
In-Reply-To: <20190514101452.10c40b6e.olaf@aepfle.de>

On Tue, May 14, 2019 at 10:14:52AM +0200, Olaf Hering wrote:
> 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)) {
> 

Yeah, from the look of it this is definitely better.

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

What do you mean here? Can't you handle the NONE case just like you do
in the resume function?

Wei.

_______________________________________________
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: Wei Liu <wei.liu2@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: "Anthony PERARD" <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Wei Liu" <wei.liu2@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 15:38:55 +0100	[thread overview]
Message-ID: <20190514143855.GH2798@zion.uk.xensource.com> (raw)
Message-ID: <20190514143855.hgnyJndAuRD_B8oL8hoDofXmk4o6X2d3JUCB0FTRjIs@z> (raw)
In-Reply-To: <20190514101452.10c40b6e.olaf@aepfle.de>

On Tue, May 14, 2019 at 10:14:52AM +0200, Olaf Hering wrote:
> 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)) {
> 

Yeah, from the look of it this is definitely better.

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

What do you mean here? Can't you handle the NONE case just like you do
in the resume function?

Wei.

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

  parent reply	other threads:[~2019-05-14 14:39 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
2019-05-14  8:14   ` [Xen-devel] " Olaf Hering
2019-05-14 14:38   ` Wei Liu [this message]
2019-05-14 14:38     ` 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=20190514143855.GH2798@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=olaf@aepfle.de \
    --cc=roger.pau@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).