From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVMfn-0001u6-0K for qemu-devel@nongnu.org; Thu, 25 Apr 2013 09:57:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVMfi-0001K8-2D for qemu-devel@nongnu.org; Thu, 25 Apr 2013 09:57:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVMfh-0001K2-Qj for qemu-devel@nongnu.org; Thu, 25 Apr 2013 09:57:13 -0400 Message-ID: <51793637.2000208@redhat.com> Date: Thu, 25 Apr 2013 07:57:11 -0600 From: Eric Blake MIME-Version: 1.0 References: <1366883435-4993-1-git-send-email-akong@redhat.com> In-Reply-To: <1366883435-4993-1-git-send-email-akong@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2UTVPPTMUAHWEDVGBDIWC" Subject: Re: [Qemu-devel] [PATCH v5] monitor: introduce query-command-line-options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, jyang@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2UTVPPTMUAHWEDVGBDIWC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/25/2013 03:50 AM, Amos Kong wrote: > Libvirt has no way to probe if an option or property is supported, > This patch introduces a new qmp command to query command line > option information. hmp command isn't added because it's not needed. >=20 > Signed-off-by: Amos Kong > CC: Luiz Capitulino > CC: Osier Yang > CC: Anthony Liguori > --- > V3: fix json schema and comments (Eric) > V4: fix descriptions, rename command, check enum type, cleanup > (Luiz, Eric) > V5: fix typo, cleanup (Osier) > --- > qapi-schema.json | 66 ++++++++++++++++++++++++++++++++++++++++++++++= +++++++ > qmp-commands.hx | 47 ++++++++++++++++++++++++++++++++++++++ > util/qemu-config.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 3 files changed, 180 insertions(+) Only minor typo fixups below; I'm assuming Luiz can fix them up while putting on the QMP pull request, without needing to see a v6. Reviewed-by: Eric Blake > +## > +# @CommandLineParameterType: > +# > +# Possible types for an option parameter. > +# > +# @string: accepts a character string > +# > +# @boolean: accepts "on" or "off" > +# > +# @number: accepts a number > +# > +# @size: accepts a number followed by an optional postfix (K)ilo, s/postfix/suffix/ > + > +## > +# @CommandLineOptionInfo: > +# > +# Details about a command line option, including its list of parameter= s details s/parameters/parameter/ > +## > +# @query-command-line-options: > +# > +# Query command line option schema. > +# > +# @option: #optional option name > +# > +# Returns: list of @CommandLineOptionInfo for all options (or for the = given > +# @option). Returns an error if the given @option doesn't ex= ist. > +# > +# Since 1.5 > +## > +{'command': 'query-command-line-options', 'data': { '*option': 'str' }= , > + 'returns': ['CommandLineOptionInfo'] } Libvirt probably won't use the optional 'option' argument. I don't care whether you leave it in or Luiz takes filtering out for the 1.5 release. > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 4d65422..31bb360 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -2416,6 +2416,53 @@ EQMP > }, > =20 > SQMP > +query-command-line-options > +-------------------------- > + > +Show command line option schema. > + > +Return a json-array of command line option schema for all options (or = for > +the given option), returning an error if the given option doesn't exis= t. > + > +Each array entry contains the following: > + > +- "option": option name (json-string) > +- "parameters": a json-array describes all parameters of the option: > + - "name": parameter name (json-string) > + - "type": parameter type (one of 'string', boolean', 'number', s/boolean'/'boolean'/ --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2UTVPPTMUAHWEDVGBDIWC 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.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJReTY3AAoJEKeha0olJ0Nqxc8IAI7NwHocdqcIM4vR6mcSd7v5 Jt5lRlRbuW9eb3l4xY9vV/VKXhfYdTseZlk37UZnbGfKVwLgeDKGrjypaHw5vffw 9po18uN/gyurRY6S4vNUSkRTm4ymzF8Kx6+197pP5vUNP9kIzlzwuJF4Iiu1yQSP Px/Uty/hjeIYjMkWKECUrJmkvIN3myLL1iPRB/0+qcPyBqllclDTtaja9GHZp202 8tZmyP9Q18itTpY/rX0PnCI469QLtin45WpoEKwxY3IMpXX3E3dDoL+jt596LMt4 lkGbA6Ss62AoNTnWHFwrrNH0+u+EBbUXPAjg+umGfaHiXeBTsVPONdVJGewoNJ8= =baon -----END PGP SIGNATURE----- ------enig2UTVPPTMUAHWEDVGBDIWC--