Enable migration without shared storage from the monitor
This patch adds the option to activate non-shared storage migration from the monitor. The migration command is as follows: (qemu) migrate -d tcp:0:4444 # for ordinary live migration (qemu) migrate -d -b tcp:0:4444 # for live migration with complete storage copy (qemu) migrate -d -i tcp:0:4444 # for live migration with incremental storage copy, storage is cow based. Changes from v4: - Minor coding style issues. Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
c163b5cae9
commit
fbc3d96cc4
26
monitor.c
26
monitor.c
@ -2908,6 +2908,18 @@ static int default_fmt_size = 4;
|
|||||||
|
|
||||||
#define MAX_ARGS 16
|
#define MAX_ARGS 16
|
||||||
|
|
||||||
|
static int is_valid_option(const char *c, const char *typestr)
|
||||||
|
{
|
||||||
|
char option[3];
|
||||||
|
|
||||||
|
option[0] = '-';
|
||||||
|
option[1] = *c;
|
||||||
|
option[2] = '\0';
|
||||||
|
|
||||||
|
typestr = strstr(typestr, option);
|
||||||
|
return (typestr != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static const mon_cmd_t *monitor_parse_command(Monitor *mon,
|
static const mon_cmd_t *monitor_parse_command(Monitor *mon,
|
||||||
const char *cmdline,
|
const char *cmdline,
|
||||||
QDict *qdict)
|
QDict *qdict)
|
||||||
@ -3100,7 +3112,8 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
|
|||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
{
|
{
|
||||||
int has_option;
|
const char *tmp = p;
|
||||||
|
int has_option, skip_key = 0;
|
||||||
/* option */
|
/* option */
|
||||||
|
|
||||||
c = *typestr++;
|
c = *typestr++;
|
||||||
@ -3111,14 +3124,23 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
|
|||||||
has_option = 0;
|
has_option = 0;
|
||||||
if (*p == '-') {
|
if (*p == '-') {
|
||||||
p++;
|
p++;
|
||||||
if (*p != c) {
|
if(c != *p) {
|
||||||
|
if(!is_valid_option(p, typestr)) {
|
||||||
|
|
||||||
monitor_printf(mon, "%s: unsupported option -%c\n",
|
monitor_printf(mon, "%s: unsupported option -%c\n",
|
||||||
cmdname, *p);
|
cmdname, *p);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
} else {
|
||||||
|
skip_key = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(skip_key) {
|
||||||
|
p = tmp;
|
||||||
|
} else {
|
||||||
p++;
|
p++;
|
||||||
has_option = 1;
|
has_option = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
qdict_put(qdict, key, qint_from_int(has_option));
|
qdict_put(qdict, key, qint_from_int(has_option));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -724,16 +724,23 @@ ETEXI
|
|||||||
|
|
||||||
{
|
{
|
||||||
.name = "migrate",
|
.name = "migrate",
|
||||||
.args_type = "detach:-d,uri:s",
|
.args_type = "detach:-d,blk:-b,inc:-i,uri:s",
|
||||||
.params = "[-d] uri",
|
.params = "[-d] [-b] [-i] uri",
|
||||||
.help = "migrate to URI (using -d to not wait for completion)",
|
.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)",
|
||||||
.user_print = monitor_user_noop,
|
.user_print = monitor_user_noop,
|
||||||
.mhandler.cmd_new = do_migrate,
|
.mhandler.cmd_new = do_migrate,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
STEXI
|
STEXI
|
||||||
@item migrate [-d] @var{uri}
|
@item migrate [-d] [-b] [-i] @var{uri}
|
||||||
Migrate to @var{uri} (using -d to not wait for completion).
|
Migrate to @var{uri} (using -d to not wait for completion).
|
||||||
|
-b for migration with full copy of disk
|
||||||
|
-i for migration with incremental copy of disk (base image is shared)
|
||||||
ETEXI
|
ETEXI
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user