[Qemu-devel] [PATCH v3 4/7] migration: migrate-continue

Dr. David Alan Gilbert (git) posted 7 patches 8 years, 3 months ago
There is a newer version of this series
[Qemu-devel] [PATCH v3 4/7] migration: migrate-continue
Posted by Dr. David Alan Gilbert (git) 8 years, 3 months ago
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

A new qmp command allows the caller to continue from a given
paused state.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/migration.c | 11 +++++++++++
 qapi/migration.json   | 17 +++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/migration/migration.c b/migration/migration.c
index 6c6d5e2c75..c9a3ee9efd 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1368,6 +1368,17 @@ void qmp_migrate_cancel(Error **errp)
     migrate_fd_cancel(migrate_get_current());
 }
 
+void qmp_migrate_continue(MigrationStatus state, Error **errp)
+{
+    MigrationState *s = migrate_get_current();
+    if (s->state != state) {
+        error_setg(errp,  "Migration not in expected state: %s",
+                   MigrationStatus_str(s->state));
+        return;
+    }
+    qemu_sem_post(&s->pause_sem);
+}
+
 void qmp_migrate_set_cache_size(int64_t value, Error **errp)
 {
     MigrationState *s = migrate_get_current();
diff --git a/qapi/migration.json b/qapi/migration.json
index b56f95db64..3b50afa6e8 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -877,6 +877,23 @@
 { 'command': 'migrate_cancel' }
 
 ##
+# @migrate-continue:
+#
+# Continue migration when it's in a paused state.
+#
+# @state: The state the migration is currently expected to be in
+#
+# Returns: nothing on success
+# Since: 2.11
+# Example:
+#
+# -> { "execute": "migrate-continue" , "arguments":
+#      { "state": "pause-before-device" } }
+# <- { "return": {} }
+##
+{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
+
+##
 # @migrate_set_downtime:
 #
 # Set maximum tolerated downtime for migration.
-- 
2.13.6


Re: [Qemu-devel] [PATCH v3 4/7] migration: migrate-continue
Posted by Peter Xu 8 years, 3 months ago
On Wed, Oct 18, 2017 at 06:40:10PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> A new qmp command allows the caller to continue from a given
> paused state.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu

Re: [Qemu-devel] [PATCH v3 4/7] migration: migrate-continue
Posted by Jiri Denemark 8 years, 3 months ago
On Wed, Oct 18, 2017 at 18:40:10 +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> A new qmp command allows the caller to continue from a given
> paused state.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
...
> diff --git a/qapi/migration.json b/qapi/migration.json
> index b56f95db64..3b50afa6e8 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -877,6 +877,23 @@
>  { 'command': 'migrate_cancel' }
>  
>  ##
> +# @migrate-continue:
> +#
> +# Continue migration when it's in a paused state.
> +#
> +# @state: The state the migration is currently expected to be in
> +#
> +# Returns: nothing on success
> +# Since: 2.11
> +# Example:
> +#
> +# -> { "execute": "migrate-continue" , "arguments":
> +#      { "state": "pause-before-device" } }

This example still uses the old name, it should be

     -> { "execute": "migrate-continue" , "arguments":
          { "state": "pre-switchover" } }

> +# <- { "return": {} }
> +##
> +{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
> +
> +##
>  # @migrate_set_downtime:
>  #
>  # Set maximum tolerated downtime for migration.

Jirka

Re: [Qemu-devel] [PATCH v3 4/7] migration: migrate-continue
Posted by Dr. David Alan Gilbert 8 years, 3 months ago
* Jiri Denemark (jdenemar@redhat.com) wrote:
> On Wed, Oct 18, 2017 at 18:40:10 +0100, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> > 
> > A new qmp command allows the caller to continue from a given
> > paused state.
> > 
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ...
> > diff --git a/qapi/migration.json b/qapi/migration.json
> > index b56f95db64..3b50afa6e8 100644
> > --- a/qapi/migration.json
> > +++ b/qapi/migration.json
> > @@ -877,6 +877,23 @@
> >  { 'command': 'migrate_cancel' }
> >  
> >  ##
> > +# @migrate-continue:
> > +#
> > +# Continue migration when it's in a paused state.
> > +#
> > +# @state: The state the migration is currently expected to be in
> > +#
> > +# Returns: nothing on success
> > +# Since: 2.11
> > +# Example:
> > +#
> > +# -> { "execute": "migrate-continue" , "arguments":
> > +#      { "state": "pause-before-device" } }
> 
> This example still uses the old name, it should be
> 
>      -> { "execute": "migrate-continue" , "arguments":
>           { "state": "pre-switchover" } }

oops, thanks; fixed.

Dave

> > +# <- { "return": {} }
> > +##
> > +{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
> > +
> > +##
> >  # @migrate_set_downtime:
> >  #
> >  # Set maximum tolerated downtime for migration.
> 
> Jirka
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK