[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 10/32] qmp: hmp: add migrate "resume" option
From: |
Peter Xu |
Subject: |
[Qemu-devel] [PATCH v4 10/32] qmp: hmp: add migrate "resume" option |
Date: |
Wed, 8 Nov 2017 14:01:08 +0800 |
It will be used when we want to resume one paused migration.
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
---
hmp-commands.hx | 7 ++++---
hmp.c | 4 +++-
migration/migration.c | 2 +-
qapi/migration.json | 5 ++++-
4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 4afd57cf5f..ffcdc34652 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -928,13 +928,14 @@ ETEXI
{
.name = "migrate",
- .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
- .params = "[-d] [-b] [-i] uri",
+ .args_type = "detach:-d,blk:-b,inc:-i,resume:-r,uri:s",
+ .params = "[-d] [-b] [-i] [-r] uri",
.help = "migrate to URI (using -d to not wait for completion)"
"\n\t\t\t -b for migration without shared storage with"
" full copy of disk\n\t\t\t -i for migration without "
"shared storage with incremental copy of disk "
- "(base image shared between src and destination)",
+ "(base image shared between src and destination)"
+ "\n\t\t\t -r to resume a paused migration",
.cmd = hmp_migrate,
},
diff --git a/hmp.c b/hmp.c
index 35a7041824..c7e1022283 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1921,10 +1921,12 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
bool detach = qdict_get_try_bool(qdict, "detach", false);
bool blk = qdict_get_try_bool(qdict, "blk", false);
bool inc = qdict_get_try_bool(qdict, "inc", false);
+ bool resume = qdict_get_try_bool(qdict, "resume", false);
const char *uri = qdict_get_str(qdict, "uri");
Error *err = NULL;
- qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false, &err);
+ qmp_migrate(uri, !!blk, blk, !!inc, inc,
+ false, false, true, resume, &err);
if (err) {
hmp_handle_error(mon, &err);
return;
diff --git a/migration/migration.c b/migration/migration.c
index 54fba8668d..b080440143 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1369,7 +1369,7 @@ bool migration_is_blocked(Error **errp)
void qmp_migrate(const char *uri, bool has_blk, bool blk,
bool has_inc, bool inc, bool has_detach, bool detach,
- Error **errp)
+ bool has_resume, bool resume, Error **errp)
{
Error *local_err = NULL;
MigrationState *s = migrate_get_current();
diff --git a/qapi/migration.json b/qapi/migration.json
index dbcd43aa40..f22fd7f3d1 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1012,6 +1012,8 @@
# @detach: this argument exists only for compatibility reasons and
# is ignored by QEMU
#
+# @resume: resume one paused migration, default "off". (since 2.12)
+#
# Returns: nothing on success
#
# Since: 0.14.0
@@ -1033,7 +1035,8 @@
#
##
{ 'command': 'migrate',
- 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
+ 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool',
+ '*detach': 'bool', '*resume': 'bool' } }
##
# @migrate-incoming:
--
2.13.6
- [Qemu-devel] [PATCH v4 00/32] Migration: postcopy failure recovery, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 02/32] migration: reuse mis->userfault_quit_fd, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 03/32] migration: provide postcopy_fault_thread_notify(), Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 01/32] migration: better error handling with QEMUFile, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 04/32] migration: new postcopy-pause state, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 06/32] migration: allow dst vm pause on postcopy, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 08/32] migration: allow send_rq to fail, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 09/32] migration: allow fault thread to pause, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 10/32] qmp: hmp: add migrate "resume" option,
Peter Xu <=
- [Qemu-devel] [PATCH v4 11/32] migration: pass MigrationState to migrate_init(), Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 15/32] migration: new cmd MIG_CMD_RECV_BITMAP, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 17/32] migration: new cmd MIG_CMD_POSTCOPY_RESUME, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 18/32] migration: new message MIG_RP_MSG_RESUME_ACK, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 19/32] migration: introduce SaveVMHandlers.resume_prepare, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 20/32] migration: synchronize dirty bitmap for resume, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 21/32] migration: setup ramstate for resume, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 23/32] migration: free SocketAddress where allocated, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 22/32] migration: final handshake for the resume, Peter Xu, 2017/11/08
- [Qemu-devel] [PATCH v4 26/32] migration: return incoming task tag for fd, Peter Xu, 2017/11/08