Revision fbc3d96c
b/monitor.c | ||
---|---|---|
2908 | 2908 |
|
2909 | 2909 |
#define MAX_ARGS 16 |
2910 | 2910 |
|
2911 |
static int is_valid_option(const char *c, const char *typestr) |
|
2912 |
{ |
|
2913 |
char option[3]; |
|
2914 |
|
|
2915 |
option[0] = '-'; |
|
2916 |
option[1] = *c; |
|
2917 |
option[2] = '\0'; |
|
2918 |
|
|
2919 |
typestr = strstr(typestr, option); |
|
2920 |
return (typestr != NULL); |
|
2921 |
} |
|
2922 |
|
|
2911 | 2923 |
static const mon_cmd_t *monitor_parse_command(Monitor *mon, |
2912 | 2924 |
const char *cmdline, |
2913 | 2925 |
QDict *qdict) |
... | ... | |
3100 | 3112 |
break; |
3101 | 3113 |
case '-': |
3102 | 3114 |
{ |
3103 |
int has_option; |
|
3115 |
const char *tmp = p; |
|
3116 |
int has_option, skip_key = 0; |
|
3104 | 3117 |
/* option */ |
3105 | 3118 |
|
3106 | 3119 |
c = *typestr++; |
... | ... | |
3111 | 3124 |
has_option = 0; |
3112 | 3125 |
if (*p == '-') { |
3113 | 3126 |
p++; |
3114 |
if (*p != c) { |
|
3115 |
monitor_printf(mon, "%s: unsupported option -%c\n", |
|
3116 |
cmdname, *p); |
|
3117 |
goto fail; |
|
3127 |
if(c != *p) { |
|
3128 |
if(!is_valid_option(p, typestr)) { |
|
3129 |
|
|
3130 |
monitor_printf(mon, "%s: unsupported option -%c\n", |
|
3131 |
cmdname, *p); |
|
3132 |
goto fail; |
|
3133 |
} else { |
|
3134 |
skip_key = 1; |
|
3135 |
} |
|
3136 |
} |
|
3137 |
if(skip_key) { |
|
3138 |
p = tmp; |
|
3139 |
} else { |
|
3140 |
p++; |
|
3141 |
has_option = 1; |
|
3118 | 3142 |
} |
3119 |
p++; |
|
3120 |
has_option = 1; |
|
3121 | 3143 |
} |
3122 | 3144 |
qdict_put(qdict, key, qint_from_int(has_option)); |
3123 | 3145 |
} |
b/qemu-monitor.hx | ||
---|---|---|
724 | 724 |
|
725 | 725 |
{ |
726 | 726 |
.name = "migrate", |
727 |
.args_type = "detach:-d,uri:s", |
|
728 |
.params = "[-d] uri", |
|
729 |
.help = "migrate to URI (using -d to not wait for completion)", |
|
730 |
.user_print = monitor_user_noop, |
|
731 |
.mhandler.cmd_new = do_migrate, |
|
727 |
.args_type = "detach:-d,blk:-b,inc:-i,uri:s", |
|
728 |
.params = "[-d] [-b] [-i] uri", |
|
729 |
.help = "migrate to URI (using -d to not wait for completion)" |
|
730 |
"\n\t\t\t -b for migration without shared storage with" |
|
731 |
" full copy of disk\n\t\t\t -i for migration without " |
|
732 |
"shared storage with incremental copy of disk " |
|
733 |
"(base image shared between src and destination)", |
|
734 |
.user_print = monitor_user_noop, |
|
735 |
.mhandler.cmd_new = do_migrate, |
|
732 | 736 |
}, |
733 | 737 |
|
738 |
|
|
734 | 739 |
STEXI |
735 |
@item migrate [-d] @var{uri} |
|
740 |
@item migrate [-d] [-b] [-i] @var{uri}
|
|
736 | 741 |
Migrate to @var{uri} (using -d to not wait for completion). |
742 |
-b for migration with full copy of disk |
|
743 |
-i for migration with incremental copy of disk (base image is shared) |
|
737 | 744 |
ETEXI |
738 | 745 |
|
739 | 746 |
{ |
Also available in: Unified diff