From patchwork Fri Jul 25 15:39:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanidhya Kashyap X-Patchwork-Id: 373740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F37F41400A3 for ; Sat, 26 Jul 2014 01:46:08 +1000 (EST) Received: from localhost ([::1]:55506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAhh8-0008Ov-4Q for incoming@patchwork.ozlabs.org; Fri, 25 Jul 2014 11:46:06 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bHiH3hgYPG68Kl1Urkn42a/paGNBRlKLBSRNTLQZiS4=; b=vxRyhrY0ytXeI0mgtvr4qoRXVAMNhP9W5Hm66YO67/sTfI+/2Nm3SRiDagG4qp+3OA KcV3Zleo9QCGqCzNBUbBWW9qRI7gHs7dJw89kFXIrKYK7Ua8PafnEHhY4NIpIt56KPiK UC1aMuPZF5dcq/Rs/OpC9FT93wVmIYioaSuuF28qqx4izuFf2oAut6FzpB7NQ6z+ROlw nzSpU3BzdQG91WO97gZs0kE7tcUqAUrlI48Q/I+uluO+JcFvxiGJ39u2kUIz/Qcxp/Ii vYs1GPbJ637hXbw3X/Z3FNshpdFYuQ+5na7NEC8iUkxP/dEA6xpIcTvg6colStkCTbdx raiQ== X-Received: by 10.68.65.101 with SMTP id w5mr14395817pbs.5.1406302855290; Fri, 25 Jul 2014 08:40:55 -0700 (PDT) Received: from localhost.localdomain ([106.219.148.212]) by mx.google.com with ESMTPSA id am3sm3693331pbd.18.2014.07.25.08.40.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jul 2014 08:40:54 -0700 (PDT) From: Sanidhya Kashyap To: qemu list Date: Fri, 25 Jul 2014 21:09:31 +0530 Message-Id: <1406302776-2306-8-git-send-email-sanidhya.iiith@gmail.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1406302776-2306-1-git-send-email-sanidhya.iiith@gmail.com> References: <1406302776-2306-1-git-send-email-sanidhya.iiith@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22c Cc: Sanidhya Kashyap , "Dr. David Alan Gilbert" , Juan Quintela Subject: [Qemu-devel] [PATCH RFC v2 07/12] VMState test: qmp interface for querying the vmstate testing process X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;