From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAhcH-0000kG-MQ for qemu-devel@nongnu.org; Fri, 25 Jul 2014 11:41:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAhc8-0001Tv-KF for qemu-devel@nongnu.org; Fri, 25 Jul 2014 11:41:05 -0400 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]:43994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAhc8-0001Tk-7F for qemu-devel@nongnu.org; Fri, 25 Jul 2014 11:40:56 -0400 Received: by mail-pa0-f44.google.com with SMTP id eu11so6347707pac.3 for ; Fri, 25 Jul 2014 08:40:55 -0700 (PDT) From: Sanidhya Kashyap Date: Fri, 25 Jul 2014 21:09:31 +0530 Message-Id: <1406302776-2306-8-git-send-email-sanidhya.iiith@gmail.com> In-Reply-To: <1406302776-2306-1-git-send-email-sanidhya.iiith@gmail.com> References: <1406302776-2306-1-git-send-email-sanidhya.iiith@gmail.com> Subject: [Qemu-devel] [PATCH RFC v2 07/12] VMState test: qmp interface for querying the vmstate testing process List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Sanidhya Kashyap , "Dr. David Alan Gilbert" , Juan Quintela 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 --- qapi-schema.json | 34 ++++++++++++++++++++++++++++++++++ qmp-commands.hx | 25 +++++++++++++++++++++++++ savevm.c | 18 ++++++++++++++++++ 3 files changed, 77 insertions(+) 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; -- 1.9.3