Message ID | 1382318062-6288-12-git-send-email-mrhines@linux.vnet.ibm.com |
---|---|
State | New |
Headers | show |
Since more integer parameters would come in the future, so how about set_migrate_parameter similar to set_migrate_capability? It sets integer value, while set_migrate_capability sets bool value. thanks, On Mon, Oct 21, 2013 at 01:14:21AM +0000, mrhines@linux.vnet.ibm.com wrote: > From: "Michael R. Hines" <mrhines@us.ibm.com> > > The capability allows management software to throttle the MC frequency > during VM application transience. > > The qemu-file savevm() functions inform the destination that the incoming > traffic is MC-specific traffic and not vanilla live-migration traffic. > > Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> > --- > hmp-commands.hx | 14 ++++++++++++++ > hmp.c | 6 ++++++ > hmp.h | 1 + > qapi-schema.json | 13 +++++++++++++ > qmp-commands.hx | 23 +++++++++++++++++++++++ > vl.c | 3 +++ > 6 files changed, 60 insertions(+) > > diff --git a/hmp-commands.hx b/hmp-commands.hx > index caae5ad..7db0597 100644 > --- a/hmp-commands.hx > +++ b/hmp-commands.hx > @@ -960,6 +960,20 @@ Set maximum tolerated downtime (in seconds) for migration. > ETEXI > > { > + .name = "migrate-set-mc-delay", > + .args_type = "value:i", > + .params = "value", > + .help = "set maximum delay (in milliseconds) between micro-checkpoints", > + .mhandler.cmd = hmp_migrate_set_mc_delay, > + }, > + > +STEXI > +@item migrate_set_downtime @var{second} > +@findex migrate_set_downtime > +Set maximum tolerated downtime (in seconds) for migration. > +ETEXI > + > + { > .name = "migrate_set_capability", > .args_type = "capability:s,state:b", > .params = "capability state", > diff --git a/hmp.c b/hmp.c > index 43896e9..8e89ac7 100644 > --- a/hmp.c > +++ b/hmp.c > @@ -1026,6 +1026,12 @@ void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict) > qmp_migrate_set_downtime(value, NULL); > } > > +void hmp_migrate_set_mc_delay(Monitor *mon, const QDict *qdict) > +{ > + int64_t value = qdict_get_int(qdict, "value"); > + qmp_migrate_set_mc_delay(value, NULL); > +} > + > void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict) > { > int64_t value = qdict_get_int(qdict, "value"); > diff --git a/hmp.h b/hmp.h > index 54cf71f..b6548a3 100644 > --- a/hmp.h > +++ b/hmp.h > @@ -60,6 +60,7 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict); > void hmp_drive_backup(Monitor *mon, const QDict *qdict); > void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); > void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); > +void hmp_migrate_set_mc_delay(Monitor *mon, const QDict *qdict); > void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); > void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict); > void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict); > diff --git a/qapi-schema.json b/qapi-schema.json > index e0a430c..2ed8098 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -2135,6 +2135,19 @@ > { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} } > > ## > +# @migrate-set-mc-delay > +# > +# Set delay (in milliseconds) between micro checkpoints. > +# > +# @value: maximum delay in milliseconds > +# > +# Returns: nothing on success > +# > +# Since: 1.6 > +## > +{ 'command': 'migrate-set-mc-delay', 'data': {'value': 'int'} } > + > +## > # @migrate_set_speed > # > # Set maximum speed for migration. > diff --git a/qmp-commands.hx b/qmp-commands.hx > index fba15cd..6d7ef2f 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -754,6 +754,29 @@ Example: > EQMP > > { > + .name = "migrate-set-mc-delay", > + .args_type = "value:i", > + .mhandler.cmd_new = qmp_marshal_input_migrate_set_mc_delay, > + }, > + > +SQMP > +migrate-set-mc-delay > +-------------------- > + > +Set maximum delay (in milliseconds) between micro-checkpoints. > + > +Arguments: > + > +- "value": maximum delay (json-int) > + > +Example: > + > +-> { "execute": "migrate-set-mc-delay", "arguments": { "value": 100 } } > +<- { "return": {} } > + > +EQMP > + > + { > .name = "client_migrate_info", > .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?", > .params = "protocol hostname port tls-port cert-subject", > diff --git a/vl.c b/vl.c > index 74d52ab..fa23d66 100644 > --- a/vl.c > +++ b/vl.c > @@ -29,6 +29,7 @@ > #include <sys/time.h> > #include <zlib.h> > #include "qemu/bitmap.h" > +#include "migration/qemu-file.h" > > /* Needed early for CONFIG_BSD etc. */ > #include "config-host.h" > @@ -4192,6 +4193,8 @@ int main(int argc, char **argv, char **envp) > default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS); > > register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL); > + register_savevm(NULL, "mc", -1, MC_VERSION, mc_info_save, > + mc_info_load, NULL); > > if (nb_numa_nodes > 0) { > int i; > -- > 1.8.1.2 > >
On 10/23/2013 07:00 AM, Isaku Yamahata wrote: > Since more integer parameters would come in the future, so how about > set_migrate_parameter similar to set_migrate_capability? > It sets integer value, while set_migrate_capability sets bool value. > > thanks, > > On Mon, Oct 21, 2013 at 01:14:21AM +0000, > mrhines@linux.vnet.ibm.com wrote: > >> From: "Michael R. Hines" <mrhines@us.ibm.com> >> >> The capability allows management software to throttle the MC frequency >> during VM application transience. >> >> The qemu-file savevm() functions inform the destination that the incoming >> traffic is MC-specific traffic and not vanilla live-migration traffic. >> >> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> >> --- >> hmp-commands.hx | 14 ++++++++++++++ >> hmp.c | 6 ++++++ >> hmp.h | 1 + >> qapi-schema.json | 13 +++++++++++++ >> qmp-commands.hx | 23 +++++++++++++++++++++++ >> vl.c | 3 +++ >> 6 files changed, 60 insertions(+) >> >> diff --git a/hmp-commands.hx b/hmp-commands.hx >> index caae5ad..7db0597 100644 >> --- a/hmp-commands.hx >> +++ b/hmp-commands.hx >> @@ -960,6 +960,20 @@ Set maximum tolerated downtime (in seconds) for migration. >> ETEXI >> >> { >> + .name = "migrate-set-mc-delay", >> + .args_type = "value:i", >> + .params = "value", >> + .help = "set maximum delay (in milliseconds) between micro-checkpoints", >> + .mhandler.cmd = hmp_migrate_set_mc_delay, >> + }, >> + >> +STEXI >> +@item migrate_set_downtime @var{second} >> +@findex migrate_set_downtime >> +Set maximum tolerated downtime (in seconds) for migration. >> +ETEXI >> + >> + { >> .name = "migrate_set_capability", >> .args_type = "capability:s,state:b", >> .params = "capability state", >> diff --git a/hmp.c b/hmp.c >> index 43896e9..8e89ac7 100644 >> --- a/hmp.c >> +++ b/hmp.c >> @@ -1026,6 +1026,12 @@ void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict) >> qmp_migrate_set_downtime(value, NULL); >> } >> >> +void hmp_migrate_set_mc_delay(Monitor *mon, const QDict *qdict) >> +{ >> + int64_t value = qdict_get_int(qdict, "value"); >> + qmp_migrate_set_mc_delay(value, NULL); >> +} >> + >> void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict) >> { >> int64_t value = qdict_get_int(qdict, "value"); >> diff --git a/hmp.h b/hmp.h >> index 54cf71f..b6548a3 100644 >> --- a/hmp.h >> +++ b/hmp.h >> @@ -60,6 +60,7 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict); >> void hmp_drive_backup(Monitor *mon, const QDict *qdict); >> void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); >> void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); >> +void hmp_migrate_set_mc_delay(Monitor *mon, const QDict *qdict); >> void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); >> void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict); >> void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict); >> diff --git a/qapi-schema.json b/qapi-schema.json >> index e0a430c..2ed8098 100644 >> --- a/qapi-schema.json >> +++ b/qapi-schema.json >> @@ -2135,6 +2135,19 @@ >> { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} } >> >> ## >> +# @migrate-set-mc-delay >> +# >> +# Set delay (in milliseconds) between micro checkpoints. >> +# >> +# @value: maximum delay in milliseconds >> +# >> +# Returns: nothing on success >> +# >> +# Since: 1.6 >> +## >> +{ 'command': 'migrate-set-mc-delay', 'data': {'value': 'int'} } >> + >> +## >> # @migrate_set_speed >> # >> # Set maximum speed for migration. >> diff --git a/qmp-commands.hx b/qmp-commands.hx >> index fba15cd..6d7ef2f 100644 >> --- a/qmp-commands.hx >> +++ b/qmp-commands.hx >> @@ -754,6 +754,29 @@ Example: >> EQMP >> >> { >> + .name = "migrate-set-mc-delay", >> + .args_type = "value:i", >> + .mhandler.cmd_new = qmp_marshal_input_migrate_set_mc_delay, >> + }, >> + >> +SQMP >> +migrate-set-mc-delay >> +-------------------- >> + >> +Set maximum delay (in milliseconds) between micro-checkpoints. >> + >> +Arguments: >> + >> +- "value": maximum delay (json-int) >> + >> +Example: >> + >> +-> { "execute": "migrate-set-mc-delay", "arguments": { "value": 100 } } >> +<- { "return": {} } >> + >> +EQMP >> + >> + { >> .name = "client_migrate_info", >> .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?", >> .params = "protocol hostname port tls-port cert-subject", >> diff --git a/vl.c b/vl.c >> index 74d52ab..fa23d66 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -29,6 +29,7 @@ >> #include <sys/time.h> >> #include <zlib.h> >> #include "qemu/bitmap.h" >> +#include "migration/qemu-file.h" >> >> /* Needed early for CONFIG_BSD etc. */ >> #include "config-host.h" >> @@ -4192,6 +4193,8 @@ int main(int argc, char **argv, char **envp) >> default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS); >> >> register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL); >> + register_savevm(NULL, "mc", -1, MC_VERSION, mc_info_save, >> + mc_info_load, NULL); >> >> if (nb_numa_nodes > 0) { >> int i; >> -- >> 1.8.1.2 >> >> That's a very good idea, I think - but we might get some pushback from the list. There is a hesitation to add such low-level parameters, but for something like micro-checkpointing that may potentially have large impacts on application performance, I do think it would be critical to expose more customizability like 'set_migrate_parameter' to management software. In fact, this separation of function may be "better" than continuing to expand the list of individual commands in the QEMU monitor. Could you submit a patch for the framework of such a command? - Michael - Michael
On Wed, Nov 06, 2013 at 11:34:25AM -0500, "Michael R. Hines" <mrhines@linux.vnet.ibm.com> wrote: > On 10/23/2013 07:00 AM, Isaku Yamahata wrote: > >Since more integer parameters would come in the future, so how about > >set_migrate_parameter similar to set_migrate_capability? > >It sets integer value, while set_migrate_capability sets bool value. > > That's a very good idea, I think - but we might get some pushback > from the list. Maybe. Actually we already have three configurable parameters. bandwith_limit, xbzrle_cache_size, max_downtime. They can be all consolidated. > There is a hesitation to add such low-level parameters, but for > something like > micro-checkpointing that may potentially have large impacts on > application performance, > I do think it would be critical to expose more customizability > like 'set_migrate_parameter' to management software. > > In fact, this separation of function may be "better" than continuing > to expand > the list of individual commands in the QEMU monitor. > > Could you submit a patch for the framework of such a command? Sure.
diff --git a/hmp-commands.hx b/hmp-commands.hx index caae5ad..7db0597 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -960,6 +960,20 @@ Set maximum tolerated downtime (in seconds) for migration. ETEXI { + .name = "migrate-set-mc-delay", + .args_type = "value:i", + .params = "value", + .help = "set maximum delay (in milliseconds) between micro-checkpoints", + .mhandler.cmd = hmp_migrate_set_mc_delay, + }, + +STEXI +@item migrate_set_downtime @var{second} +@findex migrate_set_downtime +Set maximum tolerated downtime (in seconds) for migration. +ETEXI + + { .name = "migrate_set_capability", .args_type = "capability:s,state:b", .params = "capability state", diff --git a/hmp.c b/hmp.c index 43896e9..8e89ac7 100644 --- a/hmp.c +++ b/hmp.c @@ -1026,6 +1026,12 @@ void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict) qmp_migrate_set_downtime(value, NULL); } +void hmp_migrate_set_mc_delay(Monitor *mon, const QDict *qdict) +{ + int64_t value = qdict_get_int(qdict, "value"); + qmp_migrate_set_mc_delay(value, NULL); +} + void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict) { int64_t value = qdict_get_int(qdict, "value"); diff --git a/hmp.h b/hmp.h index 54cf71f..b6548a3 100644 --- a/hmp.h +++ b/hmp.h @@ -60,6 +60,7 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict); void hmp_drive_backup(Monitor *mon, const QDict *qdict); void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); +void hmp_migrate_set_mc_delay(Monitor *mon, const QDict *qdict); void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict); void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict); diff --git a/qapi-schema.json b/qapi-schema.json index e0a430c..2ed8098 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2135,6 +2135,19 @@ { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} } ## +# @migrate-set-mc-delay +# +# Set delay (in milliseconds) between micro checkpoints. +# +# @value: maximum delay in milliseconds +# +# Returns: nothing on success +# +# Since: 1.6 +## +{ 'command': 'migrate-set-mc-delay', 'data': {'value': 'int'} } + +## # @migrate_set_speed # # Set maximum speed for migration. diff --git a/qmp-commands.hx b/qmp-commands.hx index fba15cd..6d7ef2f 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -754,6 +754,29 @@ Example: EQMP { + .name = "migrate-set-mc-delay", + .args_type = "value:i", + .mhandler.cmd_new = qmp_marshal_input_migrate_set_mc_delay, + }, + +SQMP +migrate-set-mc-delay +-------------------- + +Set maximum delay (in milliseconds) between micro-checkpoints. + +Arguments: + +- "value": maximum delay (json-int) + +Example: + +-> { "execute": "migrate-set-mc-delay", "arguments": { "value": 100 } } +<- { "return": {} } + +EQMP + + { .name = "client_migrate_info", .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?", .params = "protocol hostname port tls-port cert-subject", diff --git a/vl.c b/vl.c index 74d52ab..fa23d66 100644 --- a/vl.c +++ b/vl.c @@ -29,6 +29,7 @@ #include <sys/time.h> #include <zlib.h> #include "qemu/bitmap.h" +#include "migration/qemu-file.h" /* Needed early for CONFIG_BSD etc. */ #include "config-host.h" @@ -4192,6 +4193,8 @@ int main(int argc, char **argv, char **envp) default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS); register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL); + register_savevm(NULL, "mc", -1, MC_VERSION, mc_info_save, + mc_info_load, NULL); if (nb_numa_nodes > 0) { int i;