Received: from eggs.gnu.org ([2001:4830:134:3::10]:53242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8X5C-0001QF-R4 for qemu-devel@nongnu.org; Wed, 29 Jan 2014 10:29:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8X58-0005zx-3S for qemu-devel@nongnu.org; Wed, 29 Jan 2014 10:29:42 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:48614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8X57-0005z7-PC for qemu-devel@nongnu.org; Wed, 29 Jan 2014 10:29:38 -0500 Date: Wed, 29 Jan 2014 16:29:37 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140129152936.GB3079@irqsave.net> References: <1390984843-2101-1-git-send-email-famz@redhat.com> <1390984843-2101-4-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1390984843-2101-4-git-send-email-famz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/4] qemu-iotests: Allow caller to disable underscore convertion for qmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , =?iso-8859-1?Q?Beno=EEt?= Canet , qemu-devel@nongnu.org, Stefan Hajnoczi Le Wednesday 29 Jan 2014 =E0 16:40:42 (+0800), Fam Zheng a =E9crit : > QMP command "block_set_io_throttle" expects underscores in parameters > instead of dashes: {iops,bps}_{rd,wr,max}. >=20 > Add optional argument conv_keys (defaults to True, backward compatible)= , > it will be used in IO throttling test case. >=20 > Signed-off-by: Fam Zheng > --- > tests/qemu-iotests/iotests.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests= .py > index ca79d09..c1f5427 100644 > --- a/tests/qemu-iotests/iotests.py > +++ b/tests/qemu-iotests/iotests.py > @@ -179,11 +179,14 @@ class VM(object): > self._popen =3D None > =20 > underscore_to_dash =3D string.maketrans('_', '-') > - def qmp(self, cmd, **args): > + def qmp(self, cmd, conv_keys=3DTrue, **args): > '''Invoke a QMP command and return the result dict''' > qmp_args =3D dict() > for k in args.keys(): > - qmp_args[k.translate(self.underscore_to_dash)] =3D args[k] > + if conv_keys: > + qmp_args[k.translate(self.underscore_to_dash)] =3D arg= s[k] > + else: > + qmp_args[k] =3D args[k] > =20 > return self._qmp.cmd(cmd, args=3Dqmp_args) > =20 > --=20 > 1.8.5.3 >=20 >=20 Reviewed-by: Benoit Canet