From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDPI1-0000cF-8R for qemu-devel@nongnu.org; Tue, 11 Feb 2014 21:11:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDPHw-0008DF-8R for qemu-devel@nongnu.org; Tue, 11 Feb 2014 21:11:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDPHv-0008Cx-Vn for qemu-devel@nongnu.org; Tue, 11 Feb 2014 21:11:00 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1C2AvY8027899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Feb 2014 21:10:57 -0500 Message-ID: <52FAD82F.4030204@redhat.com> Date: Tue, 11 Feb 2014 19:10:55 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392168134-14789-1-git-send-email-famz@redhat.com> In-Reply-To: <1392168134-14789-1-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xDRBLNTpTgmi4vxx8mLATdQVm7AMDCd7d" Subject: Re: [Qemu-devel] [PATCH v2] QMP: Allow dot separated dict path arguments in qmp-shell List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Igor Mammedov , Stefan Hajnoczi , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xDRBLNTpTgmi4vxx8mLATdQVm7AMDCd7d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/11/2014 06:22 PM, Fam Zheng wrote: > As another convinience to allow using commands that expect a dict as s/convinience/convenience/ > argument, this patch adds support for foo.bar=3Dvalue syntax, similar t= o > command line argument style: >=20 > (QEMU) blockdev-add options.driver=3Dfile options.id=3Ddrive1 options= =2Efilename=3D... >=20 > Signed-off-by: Fam Zheng > + if type(d) is not dict: > + raise QMPShellError('Can not use "%s" as both leaf= and non-leaf key' % '.'.join(curpath)) s/Can not/Cannot/ > + parent[p] =3D d > + parent =3D d > + if optpath[-1] in parent: > + if type(parent[optpath[-1]]) is dict: > + raise QMPShellError('Can not use "%s" as both leaf= and non-leaf key' % '.'.join(curpath)) > + else: > + raise QMPShellError('Can not set "%s" for multiple= times' % opt[0]) twice more. Also, s/for // --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --xDRBLNTpTgmi4vxx8mLATdQVm7AMDCd7d Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS+tgvAAoJEKeha0olJ0NqXvMH/0ZBiupXtv5HXpTkZSAljIRz 4ROVHEJt8LQjcMYuOI0jGFTd/t2USBA3qC+iPjLcltuvDyKwL1W1FkFq6sVYbDGt B8jgsl5Z4k4/2GoY8b0816x1IsnfIVyKu+T2xgMba5uZCqnxTUkd0CnOT3o0aVEE mQrTTJlkAp81oOb8FI2xNmsysOYXdRi4or+YEsF1WbEZShE+/GpfzB1+HrGKD600 soV/JtVqDqVot7FFtLxSjw7xJvshoW0Jm/bl47DYnlVU6JBwdO3tzpiCqjr/V1rI Uo1zDaiANWbkZ55L2JPBHmT/VGoUz96yrRudAHwXTSSFAYyTsXBebfyz6JNZKas= =LLuy -----END PGP SIGNATURE----- --xDRBLNTpTgmi4vxx8mLATdQVm7AMDCd7d--