[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 10/28] qmp: hmp: add migrate "resume" option
From: |
Peter Xu |
Subject: |
[Qemu-devel] [PATCH v5 10/28] qmp: hmp: add migrate "resume" option |
Date: |
Tue, 5 Dec 2017 14:52:49 +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 90ff49a271..ad4cbfc820 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1363,7 +1363,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 ff336a4f5c..2ea12fcad4 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.14.3
- [Qemu-devel] [PATCH v5 02/28] migration: reuse mis->userfault_quit_fd, (continued)
- [Qemu-devel] [PATCH v5 02/28] migration: reuse mis->userfault_quit_fd, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 03/28] migration: provide postcopy_fault_thread_notify(), Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 04/28] migration: new postcopy-pause state, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 05/28] migration: implement "postcopy-pause" src logic, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 07/28] migration: allow src return path to pause, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 06/28] migration: allow dst vm pause on postcopy, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 08/28] migration: allow send_rq to fail, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 09/28] migration: allow fault thread to pause, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 10/28] qmp: hmp: add migrate "resume" option,
Peter Xu <=
- [Qemu-devel] [PATCH v5 11/28] migration: pass MigrationState to migrate_init(), Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 12/28] migration: rebuild channel on source, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 13/28] migration: new state "postcopy-recover", Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 14/28] migration: wakeup dst ram-load-thread for recover, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 15/28] migration: new cmd MIG_CMD_RECV_BITMAP, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 16/28] migration: new message MIG_RP_MSG_RECV_BITMAP, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 17/28] migration: new cmd MIG_CMD_POSTCOPY_RESUME, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 18/28] migration: new message MIG_RP_MSG_RESUME_ACK, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 19/28] migration: introduce SaveVMHandlers.resume_prepare, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 20/28] migration: synchronize dirty bitmap for resume, Peter Xu, 2017/12/05