All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] migration, xen: Fix block image lock issue on live migration
@ 2017-10-02 16:30 ` Anthony PERARD
  0 siblings, 0 replies; 12+ messages in thread
From: Anthony PERARD @ 2017-10-02 16:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Anthony PERARD, xen-devel, Ian Jackson, Wei Liu, Juan Quintela,
	Dr. David Alan Gilbert

When doing a live migration of a Xen guest with libxl, the images for
block devices are locked by the original QEMU process, and this prevent
the QEMU at the destination to take the lock and the migration fail.

>From QEMU point of view, once the RAM of a domain is migrated, there is
two QMP commands, "stop" then "xen-save-devices-state", at which point a
new QEMU is spawned at the destination.

Release locks in "xen-save-devices-state" so the destination can takes
them.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
CCing libxl maintainers:
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 migration/savevm.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/migration/savevm.c b/migration/savevm.c
index 4a88228614..69d904c179 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2263,6 +2263,20 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
     qemu_fclose(f);
     if (ret < 0) {
         error_setg(errp, QERR_IO_ERROR);
+    } else {
+        /* libxl calls the QMP command "stop" before calling
+         * "xen-save-devices-state" and in case of migration failure, libxl
+         * would call "cont".
+         * So call bdrv_inactivate_all (release locks) here to let the other
+         * side of the migration take controle of the images.
+         */
+        if (!saved_vm_running) {
+            ret = bdrv_inactivate_all();
+            if (ret) {
+                error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)",
+                           __func__, ret);
+            }
+        }
     }
 
  the_end:
-- 
Anthony PERARD

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] migration, xen: Fix block image lock issue on live migration
@ 2017-10-02 16:30 ` Anthony PERARD
  0 siblings, 0 replies; 12+ messages in thread
From: Anthony PERARD @ 2017-10-02 16:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Wei Liu, Juan Quintela, Ian Jackson, Dr. David Alan Gilbert,
	Anthony PERARD, xen-devel

When doing a live migration of a Xen guest with libxl, the images for
block devices are locked by the original QEMU process, and this prevent
the QEMU at the destination to take the lock and the migration fail.

From QEMU point of view, once the RAM of a domain is migrated, there is
two QMP commands, "stop" then "xen-save-devices-state", at which point a
new QEMU is spawned at the destination.

Release locks in "xen-save-devices-state" so the destination can takes
them.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
CCing libxl maintainers:
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 migration/savevm.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/migration/savevm.c b/migration/savevm.c
index 4a88228614..69d904c179 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2263,6 +2263,20 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
     qemu_fclose(f);
     if (ret < 0) {
         error_setg(errp, QERR_IO_ERROR);
+    } else {
+        /* libxl calls the QMP command "stop" before calling
+         * "xen-save-devices-state" and in case of migration failure, libxl
+         * would call "cont".
+         * So call bdrv_inactivate_all (release locks) here to let the other
+         * side of the migration take controle of the images.
+         */
+        if (!saved_vm_running) {
+            ret = bdrv_inactivate_all();
+            if (ret) {
+                error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)",
+                           __func__, ret);
+            }
+        }
     }
 
  the_end:
-- 
Anthony PERARD


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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH] migration, xen: Fix block image lock issue on live migration
  2017-10-02 16:30 ` Anthony PERARD
@ 2017-10-02 19:18   ` Dr. David Alan Gilbert
  -1 siblings, 0 replies; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2017-10-02 19:18 UTC (permalink / raw)
  To: Anthony PERARD, kwolf
  Cc: qemu-devel, xen-devel, Ian Jackson, Wei Liu, Juan Quintela

Adding in kwolf;  it looks sane to me; Kevin?
If I'm reading this right, this is just after the device state save.

Dave

* Anthony PERARD (anthony.perard@citrix.com) wrote:
> When doing a live migration of a Xen guest with libxl, the images for
> block devices are locked by the original QEMU process, and this prevent
> the QEMU at the destination to take the lock and the migration fail.
> 
> From QEMU point of view, once the RAM of a domain is migrated, there is
> two QMP commands, "stop" then "xen-save-devices-state", at which point a
> new QEMU is spawned at the destination.
> 
> Release locks in "xen-save-devices-state" so the destination can takes
> them.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> CCing libxl maintainers:
> CC: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> ---
>  migration/savevm.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 4a88228614..69d904c179 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -2263,6 +2263,20 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
>      qemu_fclose(f);
>      if (ret < 0) {
>          error_setg(errp, QERR_IO_ERROR);
> +    } else {
> +        /* libxl calls the QMP command "stop" before calling
> +         * "xen-save-devices-state" and in case of migration failure, libxl
> +         * would call "cont".
> +         * So call bdrv_inactivate_all (release locks) here to let the other
> +         * side of the migration take controle of the images.
> +         */
> +        if (!saved_vm_running) {
> +            ret = bdrv_inactivate_all();
> +            if (ret) {
> +                error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)",
> +                           __func__, ret);
> +            }
> +        }
>      }
>  
>   the_end:
> -- 
> Anthony PERARD
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] migration, xen: Fix block image lock issue on live migration
@ 2017-10-02 19:18   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2017-10-02 19:18 UTC (permalink / raw)
  To: Anthony PERARD, kwolf
  Cc: xen-devel, Juan Quintela, Ian Jackson, qemu-devel, Wei Liu

Adding in kwolf;  it looks sane to me; Kevin?
If I'm reading this right, this is just after the device state save.

Dave

* Anthony PERARD (anthony.perard@citrix.com) wrote:
> When doing a live migration of a Xen guest with libxl, the images for
> block devices are locked by the original QEMU process, and this prevent
> the QEMU at the destination to take the lock and the migration fail.
> 
> From QEMU point of view, once the RAM of a domain is migrated, there is
> two QMP commands, "stop" then "xen-save-devices-state", at which point a
> new QEMU is spawned at the destination.
> 
> Release locks in "xen-save-devices-state" so the destination can takes
> them.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> CCing libxl maintainers:
> CC: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> ---
>  migration/savevm.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 4a88228614..69d904c179 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -2263,6 +2263,20 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
>      qemu_fclose(f);
>      if (ret < 0) {
>          error_setg(errp, QERR_IO_ERROR);
> +    } else {
> +        /* libxl calls the QMP command "stop" before calling
> +         * "xen-save-devices-state" and in case of migration failure, libxl
> +         * would call "cont".
> +         * So call bdrv_inactivate_all (release locks) here to let the other
> +         * side of the migration take controle of the images.
> +         */
> +        if (!saved_vm_running) {
> +            ret = bdrv_inactivate_all();
> +            if (ret) {
> +                error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)",
> +                           __func__, ret);
> +            }
> +        }
>      }
>  
>   the_end:
> -- 
> Anthony PERARD
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] migration, xen: Fix block image lock issue on live migration
  2017-10-02 16:30 ` Anthony PERARD
@ 2017-10-03 11:33   ` Roger Pau Monné
  -1 siblings, 0 replies; 12+ messages in thread
From: Roger Pau Monné @ 2017-10-03 11:33 UTC (permalink / raw)
  To: Anthony PERARD
  Cc: qemu-devel, Wei Liu, Juan Quintela, Ian Jackson,
	Dr. David Alan Gilbert, xen-devel

On Mon, Oct 02, 2017 at 04:30:58PM +0000, Anthony PERARD wrote:
> When doing a live migration of a Xen guest with libxl, the images for
> block devices are locked by the original QEMU process, and this prevent
> the QEMU at the destination to take the lock and the migration fail.
> 
> From QEMU point of view, once the RAM of a domain is migrated, there is
> two QMP commands, "stop" then "xen-save-devices-state", at which point a
> new QEMU is spawned at the destination.
> 
> Release locks in "xen-save-devices-state" so the destination can takes
> them.

What happens if the migration fails on the destination? Will QEMU pick
the lock again when resuming on the source in this case?

Thanks, Roger.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] migration, xen: Fix block image lock issue on live migration
@ 2017-10-03 11:33   ` Roger Pau Monné
  0 siblings, 0 replies; 12+ messages in thread
From: Roger Pau Monné @ 2017-10-03 11:33 UTC (permalink / raw)
  To: Anthony PERARD
  Cc: Wei Liu, Juan Quintela, Ian Jackson, qemu-devel,
	Dr. David Alan Gilbert, xen-devel

On Mon, Oct 02, 2017 at 04:30:58PM +0000, Anthony PERARD wrote:
> When doing a live migration of a Xen guest with libxl, the images for
> block devices are locked by the original QEMU process, and this prevent
> the QEMU at the destination to take the lock and the migration fail.
> 
> From QEMU point of view, once the RAM of a domain is migrated, there is
> two QMP commands, "stop" then "xen-save-devices-state", at which point a
> new QEMU is spawned at the destination.
> 
> Release locks in "xen-save-devices-state" so the destination can takes
> them.

What happens if the migration fails on the destination? Will QEMU pick
the lock again when resuming on the source in this case?

Thanks, Roger.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH] migration, xen: Fix block image lock issue on live migration
  2017-10-03 11:33   ` Roger Pau Monné
@ 2017-10-03 11:47     ` Anthony PERARD
  -1 siblings, 0 replies; 12+ messages in thread
From: Anthony PERARD @ 2017-10-03 11:47 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: qemu-devel, Wei Liu, Juan Quintela, Ian Jackson,
	Dr. David Alan Gilbert, xen-devel

On Tue, Oct 03, 2017 at 12:33:37PM +0100, Roger Pau Monné wrote:
> On Mon, Oct 02, 2017 at 04:30:58PM +0000, Anthony PERARD wrote:
> > When doing a live migration of a Xen guest with libxl, the images for
> > block devices are locked by the original QEMU process, and this prevent
> > the QEMU at the destination to take the lock and the migration fail.
> > 
> > From QEMU point of view, once the RAM of a domain is migrated, there is
> > two QMP commands, "stop" then "xen-save-devices-state", at which point a
> > new QEMU is spawned at the destination.
> > 
> > Release locks in "xen-save-devices-state" so the destination can takes
> > them.
> 
> What happens if the migration fails on the destination? Will QEMU pick
> the lock again when resuming on the source in this case?

Yes, calling the QMP command "cont" to resume the activity makes QEMU
take the lock again, and libxl would call "cont". (I don't think you can
pick this kind of lock ;-). )

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] migration, xen: Fix block image lock issue on live migration
@ 2017-10-03 11:47     ` Anthony PERARD
  0 siblings, 0 replies; 12+ messages in thread
From: Anthony PERARD @ 2017-10-03 11:47 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Wei Liu, Juan Quintela, Ian Jackson, qemu-devel,
	Dr. David Alan Gilbert, xen-devel

On Tue, Oct 03, 2017 at 12:33:37PM +0100, Roger Pau Monné wrote:
> On Mon, Oct 02, 2017 at 04:30:58PM +0000, Anthony PERARD wrote:
> > When doing a live migration of a Xen guest with libxl, the images for
> > block devices are locked by the original QEMU process, and this prevent
> > the QEMU at the destination to take the lock and the migration fail.
> > 
> > From QEMU point of view, once the RAM of a domain is migrated, there is
> > two QMP commands, "stop" then "xen-save-devices-state", at which point a
> > new QEMU is spawned at the destination.
> > 
> > Release locks in "xen-save-devices-state" so the destination can takes
> > them.
> 
> What happens if the migration fails on the destination? Will QEMU pick
> the lock again when resuming on the source in this case?

Yes, calling the QMP command "cont" to resume the activity makes QEMU
take the lock again, and libxl would call "cont". (I don't think you can
pick this kind of lock ;-). )

-- 
Anthony PERARD

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH] migration, xen: Fix block image lock issue on live migration
  2017-10-02 19:18   ` Dr. David Alan Gilbert
@ 2017-10-04 13:03     ` Kevin Wolf
  -1 siblings, 0 replies; 12+ messages in thread
From: Kevin Wolf @ 2017-10-04 13:03 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: Anthony PERARD, qemu-devel, xen-devel, Ian Jackson, Wei Liu,
	Juan Quintela

Am 02.10.2017 um 21:18 hat Dr. David Alan Gilbert geschrieben:
> Adding in kwolf;  it looks sane to me; Kevin?
> If I'm reading this right, this is just after the device state save.

Is this actual migration? Because the code looks more like it's copied
and adapted from the snapshot code rather than from the actual migration
code.

If Xen doesn't use the standard mechanisms, I don't know what they need
to do. Snapshots don't need to inactivate images, but migration does.
Compared to the normal migration path, this looks very simplistic, so I
wouldn't be surprised if there was more wrong than just file locking.

This looks like it could work as a hack to the problem at hand. Whether
it is a proper solution, I can't say without investing a lot more time.

Kevin

> * Anthony PERARD (anthony.perard@citrix.com) wrote:
> > When doing a live migration of a Xen guest with libxl, the images for
> > block devices are locked by the original QEMU process, and this prevent
> > the QEMU at the destination to take the lock and the migration fail.
> > 
> > From QEMU point of view, once the RAM of a domain is migrated, there is
> > two QMP commands, "stop" then "xen-save-devices-state", at which point a
> > new QEMU is spawned at the destination.
> > 
> > Release locks in "xen-save-devices-state" so the destination can takes
> > them.
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> > ---
> > CCing libxl maintainers:
> > CC: Ian Jackson <ian.jackson@eu.citrix.com>
> > CC: Wei Liu <wei.liu2@citrix.com>
> > ---
> >  migration/savevm.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/migration/savevm.c b/migration/savevm.c
> > index 4a88228614..69d904c179 100644
> > --- a/migration/savevm.c
> > +++ b/migration/savevm.c
> > @@ -2263,6 +2263,20 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
> >      qemu_fclose(f);
> >      if (ret < 0) {
> >          error_setg(errp, QERR_IO_ERROR);
> > +    } else {
> > +        /* libxl calls the QMP command "stop" before calling
> > +         * "xen-save-devices-state" and in case of migration failure, libxl
> > +         * would call "cont".
> > +         * So call bdrv_inactivate_all (release locks) here to let the other
> > +         * side of the migration take controle of the images.
> > +         */
> > +        if (!saved_vm_running) {
> > +            ret = bdrv_inactivate_all();
> > +            if (ret) {
> > +                error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)",
> > +                           __func__, ret);
> > +            }
> > +        }
> >      }
> >  
> >   the_end:
> > -- 
> > Anthony PERARD
> > 
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] migration, xen: Fix block image lock issue on live migration
@ 2017-10-04 13:03     ` Kevin Wolf
  0 siblings, 0 replies; 12+ messages in thread
From: Kevin Wolf @ 2017-10-04 13:03 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: Wei Liu, Juan Quintela, Ian Jackson, qemu-devel, Anthony PERARD,
	xen-devel

Am 02.10.2017 um 21:18 hat Dr. David Alan Gilbert geschrieben:
> Adding in kwolf;  it looks sane to me; Kevin?
> If I'm reading this right, this is just after the device state save.

Is this actual migration? Because the code looks more like it's copied
and adapted from the snapshot code rather than from the actual migration
code.

If Xen doesn't use the standard mechanisms, I don't know what they need
to do. Snapshots don't need to inactivate images, but migration does.
Compared to the normal migration path, this looks very simplistic, so I
wouldn't be surprised if there was more wrong than just file locking.

This looks like it could work as a hack to the problem at hand. Whether
it is a proper solution, I can't say without investing a lot more time.

Kevin

> * Anthony PERARD (anthony.perard@citrix.com) wrote:
> > When doing a live migration of a Xen guest with libxl, the images for
> > block devices are locked by the original QEMU process, and this prevent
> > the QEMU at the destination to take the lock and the migration fail.
> > 
> > From QEMU point of view, once the RAM of a domain is migrated, there is
> > two QMP commands, "stop" then "xen-save-devices-state", at which point a
> > new QEMU is spawned at the destination.
> > 
> > Release locks in "xen-save-devices-state" so the destination can takes
> > them.
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> > ---
> > CCing libxl maintainers:
> > CC: Ian Jackson <ian.jackson@eu.citrix.com>
> > CC: Wei Liu <wei.liu2@citrix.com>
> > ---
> >  migration/savevm.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/migration/savevm.c b/migration/savevm.c
> > index 4a88228614..69d904c179 100644
> > --- a/migration/savevm.c
> > +++ b/migration/savevm.c
> > @@ -2263,6 +2263,20 @@ void qmp_xen_save_devices_state(const char *filename, Error **errp)
> >      qemu_fclose(f);
> >      if (ret < 0) {
> >          error_setg(errp, QERR_IO_ERROR);
> > +    } else {
> > +        /* libxl calls the QMP command "stop" before calling
> > +         * "xen-save-devices-state" and in case of migration failure, libxl
> > +         * would call "cont".
> > +         * So call bdrv_inactivate_all (release locks) here to let the other
> > +         * side of the migration take controle of the images.
> > +         */
> > +        if (!saved_vm_running) {
> > +            ret = bdrv_inactivate_all();
> > +            if (ret) {
> > +                error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)",
> > +                           __func__, ret);
> > +            }
> > +        }
> >      }
> >  
> >   the_end:
> > -- 
> > Anthony PERARD
> > 
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH] migration, xen: Fix block image lock issue on live migration
  2017-10-04 13:03     ` Kevin Wolf
@ 2017-10-24 12:11       ` Anthony PERARD
  -1 siblings, 0 replies; 12+ messages in thread
From: Anthony PERARD @ 2017-10-24 12:11 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: Dr. David Alan Gilbert, qemu-devel, xen-devel, Ian Jackson,
	Wei Liu, Juan Quintela

On Wed, Oct 04, 2017 at 03:03:49PM +0200, Kevin Wolf wrote:
> Am 02.10.2017 um 21:18 hat Dr. David Alan Gilbert geschrieben:
> > Adding in kwolf;  it looks sane to me; Kevin?
> > If I'm reading this right, this is just after the device state save.
> 
> Is this actual migration? Because the code looks more like it's copied
> and adapted from the snapshot code rather than from the actual migration
> code.

Well the Xen tool stack takes care of the migration, we only need to
save the device states from QEMU, I guess similair to a snapshot.

> If Xen doesn't use the standard mechanisms, I don't know what they need
> to do. Snapshots don't need to inactivate images, but migration does.
> Compared to the normal migration path, this looks very simplistic, so I
> wouldn't be surprised if there was more wrong than just file locking.

I realize now that if one would want to take a snapshot of a running
Xen guest, this xen-save-devices-state qmp command will be called as
well.

So I can see a few options to better handle snapshots, we could:
- Add a new parameter to xen-save-devices-state, "live_migration" which
  could default to 'true' so older version of Xen will still works.
- Create a new qmp command that sole purpose is to call
  bdrv_inactivate_all, I don't know what else this command would have to
  do.
- or just take this patch.

Thanks.

> This looks like it could work as a hack to the problem at hand. Whether
> it is a proper solution, I can't say without investing a lot more time.


-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] migration, xen: Fix block image lock issue on live migration
@ 2017-10-24 12:11       ` Anthony PERARD
  0 siblings, 0 replies; 12+ messages in thread
From: Anthony PERARD @ 2017-10-24 12:11 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: Wei Liu, Juan Quintela, Ian Jackson, Dr. David Alan Gilbert,
	qemu-devel, xen-devel

On Wed, Oct 04, 2017 at 03:03:49PM +0200, Kevin Wolf wrote:
> Am 02.10.2017 um 21:18 hat Dr. David Alan Gilbert geschrieben:
> > Adding in kwolf;  it looks sane to me; Kevin?
> > If I'm reading this right, this is just after the device state save.
> 
> Is this actual migration? Because the code looks more like it's copied
> and adapted from the snapshot code rather than from the actual migration
> code.

Well the Xen tool stack takes care of the migration, we only need to
save the device states from QEMU, I guess similair to a snapshot.

> If Xen doesn't use the standard mechanisms, I don't know what they need
> to do. Snapshots don't need to inactivate images, but migration does.
> Compared to the normal migration path, this looks very simplistic, so I
> wouldn't be surprised if there was more wrong than just file locking.

I realize now that if one would want to take a snapshot of a running
Xen guest, this xen-save-devices-state qmp command will be called as
well.

So I can see a few options to better handle snapshots, we could:
- Add a new parameter to xen-save-devices-state, "live_migration" which
  could default to 'true' so older version of Xen will still works.
- Create a new qmp command that sole purpose is to call
  bdrv_inactivate_all, I don't know what else this command would have to
  do.
- or just take this patch.

Thanks.

> This looks like it could work as a hack to the problem at hand. Whether
> it is a proper solution, I can't say without investing a lot more time.


-- 
Anthony PERARD

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-10-24 12:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-02 16:30 [Qemu-devel] [PATCH] migration, xen: Fix block image lock issue on live migration Anthony PERARD
2017-10-02 16:30 ` Anthony PERARD
2017-10-02 19:18 ` [Qemu-devel] " Dr. David Alan Gilbert
2017-10-02 19:18   ` Dr. David Alan Gilbert
2017-10-04 13:03   ` [Qemu-devel] " Kevin Wolf
2017-10-04 13:03     ` Kevin Wolf
2017-10-24 12:11     ` [Qemu-devel] " Anthony PERARD
2017-10-24 12:11       ` Anthony PERARD
2017-10-03 11:33 ` [Qemu-devel] [Xen-devel] " Roger Pau Monné
2017-10-03 11:33   ` Roger Pau Monné
2017-10-03 11:47   ` [Qemu-devel] [Xen-devel] " Anthony PERARD
2017-10-03 11:47     ` Anthony PERARD

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.