[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 40/41] migrate: add -m (movebg) option to migrate
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH v2 40/41] migrate: add -m (movebg) option to migrate command |
Date: |
Mon, 4 Jun 2012 18:57:42 +0900 |
Signed-off-by: Isaku Yamahata <address@hidden>
---
hmp-commands.hx | 5 +++--
hmp.c | 3 ++-
migration.c | 8 +++++++-
migration.h | 1 +
qapi-schema.json | 2 +-
qmp-commands.hx | 2 +-
savevm.c | 1 +
7 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 38e5c95..1912cb8 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -798,15 +798,16 @@ ETEXI
{
.name = "migrate",
- .args_type = "detach:-d,blk:-b,inc:-i,postcopy:-p,nobg:-n,uri:s,"
+ .args_type =
"detach:-d,blk:-b,inc:-i,postcopy:-p,movebg:-m,nobg:-n,uri:s,"
"forward:i?,backward:i?",
- .params = "[-d] [-b] [-i] [-p [-n] uri [forward] [backword]",
+ .params = "[-d] [-b] [-i] [-p [-n] [-m] uri [forward] [backword]",
.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)"
"\n\t\t\t-p for migration with postcopy mode enabled"
+ "\n\t\t\t-m for move background transfer of postcopy mode"
"\n\t\t\t-n for no background transfer of postcopy mode"
"\n\t\t\tforward: the number of pages to "
"forward-prefault when postcopy (default 0)"
diff --git a/hmp.c b/hmp.c
index 79a9c86..dd3f307 100644
--- a/hmp.c
+++ b/hmp.c
@@ -912,6 +912,7 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
int blk = qdict_get_try_bool(qdict, "blk", 0);
int inc = qdict_get_try_bool(qdict, "inc", 0);
int postcopy = qdict_get_try_bool(qdict, "postcopy", 0);
+ int movebg = qdict_get_try_bool(qdict, "movebg", 0);
int nobg = qdict_get_try_bool(qdict, "nobg", 0);
int forward = qdict_get_try_int(qdict, "forward", 0);
int backward = qdict_get_try_int(qdict, "backward", 0);
@@ -919,7 +920,7 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
Error *err = NULL;
qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false,
- !!postcopy, postcopy, !!nobg, nobg,
+ !!postcopy, postcopy, !!movebg, movebg, !!nobg, nobg,
!!forward, forward, !!backward, backward,
&err);
if (err) {
diff --git a/migration.c b/migration.c
index e026085..c5e6820 100644
--- a/migration.c
+++ b/migration.c
@@ -422,7 +422,9 @@ void migrate_del_blocker(Error *reason)
void qmp_migrate(const char *uri, bool has_blk, bool blk,
bool has_inc, bool inc, bool has_detach, bool detach,
- bool has_postcopy, bool postcopy, bool has_nobg, bool nobg,
+ bool has_postcopy, bool postcopy,
+ bool has_movebg, bool movebg,
+ bool has_nobg, bool nobg,
bool has_forward, int64_t forward,
bool has_backward, int64_t backward,
Error **errp)
@@ -432,6 +434,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
.blk = false,
.shared = false,
.postcopy = false,
+ .movebg = false,
.nobg = false,
.prefault_forward = 0,
.prefault_backward = 0,
@@ -448,6 +451,9 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
if (has_postcopy) {
params.postcopy = postcopy;
}
+ if (has_movebg) {
+ params.movebg = movebg;
+ }
if (has_nobg) {
params.nobg = nobg;
}
diff --git a/migration.h b/migration.h
index 9a9b9c6..1e98b20 100644
--- a/migration.h
+++ b/migration.h
@@ -23,6 +23,7 @@ struct MigrationParams {
int blk;
int shared;
int postcopy;
+ int movebg;
int nobg;
int64_t prefault_forward;
int64_t prefault_backward;
diff --git a/qapi-schema.json b/qapi-schema.json
index 83c2170..ef2f48e 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1718,7 +1718,7 @@
##
{ 'command': 'migrate',
'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' ,
- '*postcopy': 'bool', '*nobg': 'bool',
+ '*postcopy': 'bool', '*movebg': 'bool', '*nobg': 'bool',
'*forward': 'int', '*backward': 'int'} }
# @xen-save-devices-state:
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 7b5e5b7..5c9ecc8 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -469,7 +469,7 @@ EQMP
{
.name = "migrate",
- .args_type = "detach:-d,blk:-b,inc:-i,postcopy:-p,nobg:-n,uri:s",
+ .args_type =
"detach:-d,blk:-b,inc:-i,postcopy:-p,movebg:-m,nobg:-n,uri:s",
.mhandler.cmd_new = qmp_marshal_input_migrate,
},
diff --git a/savevm.c b/savevm.c
index 48b636d..19bb8f1 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1781,6 +1781,7 @@ static int qemu_savevm_state(QEMUFile *f)
.blk = 0,
.shared = 0,
.postcopy = 0,
+ .movebg = 0,
.nobg = 0,
};
--
1.7.1.1
- [Qemu-devel] [PATCH v2 08/41] arch_init/ram_load: refactor ram_load, (continued)
- [Qemu-devel] [PATCH v2 08/41] arch_init/ram_load: refactor ram_load, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 28/41] buffered_file: add qemu_file to read/write to buffer in memory, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 33/41] postcopy: introduce -postcopy and -postcopy-flags option, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 12/41] arch_init: factor out setting last_block, last_offset, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 36/41] postcopy: implement incoming part of postcopy live migration, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 41/41] migration/postcopy: add movebg mode, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 40/41] migrate: add -m (movebg) option to migrate command,
Isaku Yamahata <=
- [Qemu-devel] [PATCH v2 37/41] postcopy: implement outgoing part of postcopy live migration, Isaku Yamahata, 2012/06/04
- [Qemu-devel] [PATCH v2 35/41] postcopy: introduce helper functions for postcopy, Isaku Yamahata, 2012/06/04
- Re: [Qemu-devel] [PATCH v2 00/41] postcopy live migration, Anthony Liguori, 2012/06/04