From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAhcV-00015m-A2 for qemu-devel@nongnu.org; Fri, 25 Jul 2014 11:41:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAhcL-0001Wt-O5 for qemu-devel@nongnu.org; Fri, 25 Jul 2014 11:41:19 -0400 Received: from mail-pd0-x232.google.com ([2607:f8b0:400e:c02::232]:63726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAhcL-0001WP-DR for qemu-devel@nongnu.org; Fri, 25 Jul 2014 11:41:09 -0400 Received: by mail-pd0-f178.google.com with SMTP id w10so5938589pde.9 for ; Fri, 25 Jul 2014 08:41:08 -0700 (PDT) From: Sanidhya Kashyap Date: Fri, 25 Jul 2014 21:09:33 +0530 Message-Id: <1406302776-2306-10-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 09/12] VMState test: update period of 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 No particular change, except variable name. Since I am not modifying other variables, so I have not made the command generic. Signed-off-by: Sanidhya Kashyap --- qapi-schema.json | 12 ++++++++++++ qmp-commands.hx | 23 +++++++++++++++++++++++ savevm.c | 13 +++++++++++++ 3 files changed, 48 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index a12872f..13e922e 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3562,3 +3562,15 @@ # Since 2.2 ## { 'command': 'query-test-vmstates', 'returns': 'VMStateLogStateInfo' } + +## +# @test-vmstates-set-period +# +# sets the sleep interval between iterations of the vmstate testing process +# +# @period: the updated sleep interval value (in milliseconds) +# +# Since 2.2 +## +{ 'command' : 'test-vmstates-set-period', + 'data' : { 'period': 'int' } } diff --git a/qmp-commands.hx b/qmp-commands.hx index 0a40a88..2f019b0 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -3842,3 +3842,26 @@ Example: "iterations": 100, "period": 100 } } EQMP + + { + .name = "test-vmstates-set-period", + .args_type = "period:i", + .mhandler.cmd_new = qmp_marshal_input_test_vmstates_set_period, + }, + +SQMP +test-vmstates-set-period +------------------------ + +Update the sleep interval for the remaining iterations + +Arguments: + +- "period": the updated sleep interval between iterations (json-int) + +Example: + +-> { "execute": "test-vmstates-set-period", "arguments": { "period": 1024 } } +<- { "return": {} } +EQMP + diff --git a/savevm.c b/savevm.c index 797be57..d5fb93b 100644 --- a/savevm.c +++ b/savevm.c @@ -1470,6 +1470,19 @@ VMStateLogStateInfo *qmp_query_test_vmstates(Error **errp) return log_info; } +void qmp_test_vmstates_set_period(int64_t period, Error **errp) +{ + VMStateLogState *v = vmstate_current_state(); + if (period < TEST_VMSTATE_MIN_INTERVAL_MS || + period > TEST_VMSTATE_MAX_INTERVAL_MS) { + error_setg(errp, "sleep interval (period) value must be " + "in the defined range [%d, %d](ms)\n", + TEST_VMSTATE_MIN_INTERVAL_MS, TEST_VMSTATE_MAX_INTERVAL_MS); + return; + } + v->period = period; +} + void qmp_xen_save_devices_state(const char *filename, Error **errp) { QEMUFile *f; -- 1.9.3