From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9iuZ-0003y3-Px for qemu-devel@nongnu.org; Mon, 19 Mar 2012 16:10:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9iuX-0002HO-IT for qemu-devel@nongnu.org; Mon, 19 Mar 2012 16:10:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9iuX-0002HB-AG for qemu-devel@nongnu.org; Mon, 19 Mar 2012 16:10:33 -0400 Message-ID: <4F6792B6.9080508@redhat.com> Date: Mon, 19 Mar 2012 14:10:30 -0600 From: Eric Blake MIME-Version: 1.0 References: <1332169763-30665-1-git-send-email-aliguori@us.ibm.com> <1332169763-30665-8-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1332169763-30665-8-git-send-email-aliguori@us.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigBA186A22652C7541904C5B48" Subject: Re: [Qemu-devel] [PATCH 7/9] qmp: expose a command to query capabilities of config parser List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Gerd Hoffman , qemu-devel@nongnu.org, Eduardo Habkost This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBA186A22652C7541904C5B48 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/19/2012 09:09 AM, Anthony Liguori wrote: > Signed-off-by: Anthony Liguori > --- > qapi-schema.json | 66 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > qemu-config.c | 51 +++++++++++++++++++++++++++++++++++++++++ > qmp-commands.hx | 5 ++++ > 3 files changed, 122 insertions(+), 0 deletions(-) >=20 > diff --git a/qapi-schema.json b/qapi-schema.json > index 04fa84f..2a80ef6 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -1663,3 +1663,69 @@ > { 'command': 'qom-list-types', > 'data': { '*implements': 'str', '*abstract': 'bool' }, > 'returns': [ 'ObjectTypeInfo' ] } > + > +## > +# @ConfigOptionType > +# > +# An enumeration describing the type of a configuration file entry. > +# > +# @string: a UTF-8 string > +# > +# @bool: either 'on' or 'off' > +# > +# @number: an integer > +# > +# @size: an integer followed by either 'K', 'M', 'G', or 'T'. Not quite - I found three different parsers, but none of them match this description. That is, qemu-option.c:parse_option_size() supports 'k' and 'b', as well as omitting a suffix, but does not support 'm'. Then there's cmd.c:cvtnum(), which is case-insensitive, and adds 'p' and 'e', but omits 'b'. Then there's the 'o' type in monitor.c that defers to cutils.c:strtosz(), which defaults to bytes but is case-insensitive and supports 'b' but not 'p'. Why are we using three different parsers, anyw= ay? Please be sure that your documentation exactly matches the code used by the particular parser used for 'size', since it is is already confusing as-is. > +# > +# @help: an optional help description. This should not be parsed or r= elied upon > +# in any way. Its content's may change in future versions of Q= EMU. s/content's/contents/ --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigBA186A22652C7541904C5B48 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPZ5K2AAoJEKeha0olJ0NqnIEH+gPPODlJ/+Cr7et1HuPV2XIM W29mhH2R8wm0VSQ7iuvsrvJzsoV3CpX/V82QYJvbcsJF0/DHBt16KxTmRDfQIEUQ YJEsUnYtQKk3/7rp2TbsVbP/QXroVBaLVm0St140mq8KG7rNC/HTknCg90sq/8r9 wOdKpAW9fezImlIYIERGzvsNz8kk5muplbePXRIRjfjCIE6ILnhWAC14qJsaTF9m wVoq0uxi6+CjPD3AshHN5qdxf0tBUphId0OmagaW1++/O6928cORGB9lWWtP8qe/ DKJP0kbhlFl2uOkoKbxx+9UmYah5DhB7eOuzmCGOXLd0VYJole8WV+9uMZXb8g8= =vM4Y -----END PGP SIGNATURE----- --------------enigBA186A22652C7541904C5B48--