diff mbox series

[v6,26/28] hmp/migration: add migrate_recover command

Message ID 20180208103132.28452-27-peterx@redhat.com
State New
Headers show
Series [v6,01/28] migration: better error handling with QEMUFile | expand

Commit Message

Peter Xu Feb. 8, 2018, 10:31 a.m. UTC
Sister command to migrate-recover in QMP.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 hmp-commands.hx | 13 +++++++++++++
 hmp.c           | 10 ++++++++++
 hmp.h           |  1 +
 3 files changed, 24 insertions(+)

Comments

Dr. David Alan Gilbert Feb. 13, 2018, 7:45 p.m. UTC | #1
* Peter Xu (peterx@redhat.com) wrote:
> Sister command to migrate-recover in QMP.
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>

Yes, useful for testing, although we don't have any OOB equivalent yet,
something I need to look at.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  hmp-commands.hx | 13 +++++++++++++
>  hmp.c           | 10 ++++++++++
>  hmp.h           |  1 +
>  3 files changed, 24 insertions(+)
> 
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index 28ed5a7a13..7563f3eaa0 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -955,7 +955,20 @@ STEXI
>  @findex migrate_incoming
>  Continue an incoming migration using the @var{uri} (that has the same syntax
>  as the -incoming option).
> +ETEXI
>  
> +    {
> +        .name       = "migrate_recover",
> +        .args_type  = "uri:s",
> +        .params     = "uri",
> +        .help       = "Continue a paused incoming postcopy migration",
> +        .cmd        = hmp_migrate_recover,
> +    },
> +
> +STEXI
> +@item migrate_recover @var{uri}
> +@findex migrate_recover
> +Continue a paused incoming postcopy migration using the @var{uri}.
>  ETEXI
>  
>      {
> diff --git a/hmp.c b/hmp.c
> index 6f8eec8365..4062d3fdba 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -1519,6 +1519,16 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict)
>      hmp_handle_error(mon, &err);
>  }
>  
> +void hmp_migrate_recover(Monitor *mon, const QDict *qdict)
> +{
> +    Error *err = NULL;
> +    const char *uri = qdict_get_str(qdict, "uri");
> +
> +    qmp_migrate_recover(uri, &err);
> +
> +    hmp_handle_error(mon, &err);
> +}
> +
>  /* Kept for backwards compatibility */
>  void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict)
>  {
> diff --git a/hmp.h b/hmp.h
> index 536cb91caa..0d53fe78d9 100644
> --- a/hmp.h
> +++ b/hmp.h
> @@ -70,6 +70,7 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict);
>  void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
>  void hmp_migrate_continue(Monitor *mon, const QDict *qdict);
>  void hmp_migrate_incoming(Monitor *mon, const QDict *qdict);
> +void hmp_migrate_recover(Monitor *mon, const QDict *qdict);
>  void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict);
>  void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict);
>  void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict);
> -- 
> 2.14.3
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Peter Xu Feb. 14, 2018, 4:48 a.m. UTC | #2
On Tue, Feb 13, 2018 at 07:45:09PM +0000, Dr. David Alan Gilbert wrote:
> * Peter Xu (peterx@redhat.com) wrote:
> > Sister command to migrate-recover in QMP.
> > 
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> 
> Yes, useful for testing, although we don't have any OOB equivalent yet,
> something I need to look at.

That'll be nice.

> 
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Thanks,
diff mbox series

Patch

diff --git a/hmp-commands.hx b/hmp-commands.hx
index 28ed5a7a13..7563f3eaa0 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -955,7 +955,20 @@  STEXI
 @findex migrate_incoming
 Continue an incoming migration using the @var{uri} (that has the same syntax
 as the -incoming option).
+ETEXI
 
+    {
+        .name       = "migrate_recover",
+        .args_type  = "uri:s",
+        .params     = "uri",
+        .help       = "Continue a paused incoming postcopy migration",
+        .cmd        = hmp_migrate_recover,
+    },
+
+STEXI
+@item migrate_recover @var{uri}
+@findex migrate_recover
+Continue a paused incoming postcopy migration using the @var{uri}.
 ETEXI
 
     {
diff --git a/hmp.c b/hmp.c
index 6f8eec8365..4062d3fdba 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1519,6 +1519,16 @@  void hmp_migrate_incoming(Monitor *mon, const QDict *qdict)
     hmp_handle_error(mon, &err);
 }
 
+void hmp_migrate_recover(Monitor *mon, const QDict *qdict)
+{
+    Error *err = NULL;
+    const char *uri = qdict_get_str(qdict, "uri");
+
+    qmp_migrate_recover(uri, &err);
+
+    hmp_handle_error(mon, &err);
+}
+
 /* Kept for backwards compatibility */
 void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict)
 {
diff --git a/hmp.h b/hmp.h
index 536cb91caa..0d53fe78d9 100644
--- a/hmp.h
+++ b/hmp.h
@@ -70,6 +70,7 @@  void hmp_info_snapshots(Monitor *mon, const QDict *qdict);
 void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
 void hmp_migrate_continue(Monitor *mon, const QDict *qdict);
 void hmp_migrate_incoming(Monitor *mon, const QDict *qdict);
+void hmp_migrate_recover(Monitor *mon, const QDict *qdict);
 void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict);
 void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict);
 void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict);