From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YC2YK-0006bS-SU for qemu-devel@nongnu.org; Fri, 16 Jan 2015 03:46:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YC2YG-0002op-0i for qemu-devel@nongnu.org; Fri, 16 Jan 2015 03:46:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YC2YF-0002ok-Py for qemu-devel@nongnu.org; Fri, 16 Jan 2015 03:46:43 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0G8khc1019975 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 16 Jan 2015 03:46:43 -0500 From: Fam Zheng Date: Fri, 16 Jan 2015 16:46:22 +0800 Message-Id: <1421397983-28065-5-git-send-email-famz@redhat.com> In-Reply-To: <1421397983-28065-1-git-send-email-famz@redhat.com> References: <1421397983-28065-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v5 4/5] qemu-iotests: Allow caller to disable underscore convertion for qmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi QMP command "block_set_io_throttle" expects underscores in parameters instead of dashes: {iops,bps}_{rd,wr,max}. Add optional argument conv_keys (defaults to True, backward compatible), it will be used in IO throttling test case. Reviewed-by: Benoit Canet Signed-off-by: Fam Zheng --- tests/qemu-iotests/iotests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 85cb9a5..1402854 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -185,11 +185,14 @@ class VM(object): self._popen = None underscore_to_dash = string.maketrans('_', '-') - def qmp(self, cmd, **args): + def qmp(self, cmd, conv_keys=True, **args): '''Invoke a QMP command and return the result dict''' qmp_args = dict() for k in args.keys(): - qmp_args[k.translate(self.underscore_to_dash)] = args[k] + if conv_keys: + qmp_args[k.translate(self.underscore_to_dash)] = args[k] + else: + qmp_args[k] = args[k] return self._qmp.cmd(cmd, args=qmp_args) -- 1.9.3