Message ID | 1406302776-2306-8-git-send-email-sanidhya.iiith@gmail.com |
---|---|
State | New |
Headers | show |
On 07/25/2014 09:39 AM, Sanidhya Kashyap wrote: > This patch provides the information about an already executing testing > process. I have modified the qmp command to query-test-vmstates from > test-vmstates-get-info. > > Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com> > --- > qapi-schema.json | 34 ++++++++++++++++++++++++++++++++++ > qmp-commands.hx | 25 +++++++++++++++++++++++++ > savevm.c | 18 ++++++++++++++++++ > 3 files changed, 77 insertions(+) > > +## > +{ 'type': 'VMStateLogStateInfo', > + 'data': { 'current-iteration': 'int', > + 'iterations': 'int', > + 'period': 'int' } } Looks okay... > +++ b/qmp-commands.hx > +SQMP > +query-test-vmstates-info > +------------------------ > + > +Get the parameters information > + > +- "current_iteration": the current iteration going on s/_/-/ > +- "iterations:" the total number of assigned iterations > +- "period": the sleep interval between the iteration > + > +Example: > + > +-> { "execute": "query-test-vmstates" } > +<- { "return": { > + "current_iteration": 3, ...but spelling doesn't match the actual code.
On 07/29/2014 09:17 AM, Eric Blake wrote: > On 07/25/2014 09:39 AM, Sanidhya Kashyap wrote: >> This patch provides the information about an already executing testing >> process. I have modified the qmp command to query-test-vmstates from >> test-vmstates-get-info. This last sentence does not belong in the commit message proper, rather, move it... >> >> Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com> >> --- ...here, as a changelog for how the v2 differs from v1. Years from now, when someone is reading qemu.git, they won't care what alternative names were proposed, only what is actually committed. > >> +++ b/qmp-commands.hx > >> +SQMP >> +query-test-vmstates-info >> +------------------------ s/-info//, to match the actual command name that you documented in the .json.
diff --git a/qapi-schema.json b/qapi-schema.json index ec48977..a12872f 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3528,3 +3528,37 @@ '*period': 'int', 'noqdev': 'bool', '*qdevices': 'VMStatesQdevDevices' } } + +## +# @VMStateLogStateInfo +# +# VMState testing information +# Tells about the current iteration, the total iterations +# that have been provided and the sleep interval +# +# @current-iteration: shows the current iteration at which +# the test is in. +# +# @iterations: the allocated total iterations for the vmstate +# testing process. +# +# @period: the allowed sleep interval between each iteration +# (in milliseconds). +# +# Since 2.2 +## +{ 'type': 'VMStateLogStateInfo', + 'data': { 'current-iteration': 'int', + 'iterations': 'int', + 'period': 'int' } } + +## +# @query-test-vmstates +# +# Get the current parameters value of the vmstate testing process. +# +# Returns VMStateLogStateInfo structure. +# +# Since 2.2 +## +{ 'command': 'query-test-vmstates', 'returns': 'VMStateLogStateInfo' } diff --git a/qmp-commands.hx b/qmp-commands.hx index 6210f56..0a40a88 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -3817,3 +3817,28 @@ Example: "noqdev": false } } <- { "return": {} } EQMP + + { + .name = "query-test-vmstates", + .args_type = "", + .mhandler.cmd_new = qmp_marshal_input_query_test_vmstates, + }, + +SQMP +query-test-vmstates-info +------------------------ + +Get the parameters information + +- "current_iteration": the current iteration going on +- "iterations:" the total number of assigned iterations +- "period": the sleep interval between the iteration + +Example: + +-> { "execute": "query-test-vmstates" } +<- { "return": { + "current_iteration": 3, + "iterations": 100, + "period": 100 } } +EQMP diff --git a/savevm.c b/savevm.c index b5e53b8..793fee7 100644 --- a/savevm.c +++ b/savevm.c @@ -1451,6 +1451,24 @@ void qmp_test_vmstates(bool has_iterations, int64_t iterations, timer_mod(v->timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME)); } +VMStateLogStateInfo *qmp_query_test_vmstates(Error **errp) +{ + VMStateLogState *v = vmstate_current_state(); + VMStateLogStateInfo *log_info = NULL; + + if (!v->active_state) { + return log_info; + } + + log_info = g_malloc0(sizeof(VMStateLogStateInfo)); + + log_info->current_iteration = v->current_iteration; + log_info->iterations = v->iterations; + log_info->period = v->period; + + return log_info; +} + void qmp_xen_save_devices_state(const char *filename, Error **errp) { QEMUFile *f;
This patch provides the information about an already executing testing process. I have modified the qmp command to query-test-vmstates from test-vmstates-get-info. Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com> --- qapi-schema.json | 34 ++++++++++++++++++++++++++++++++++ qmp-commands.hx | 25 +++++++++++++++++++++++++ savevm.c | 18 ++++++++++++++++++ 3 files changed, 77 insertions(+)