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. > > Signed-off-by: Amos Kong <ak...@redhat.com> > CC: Luiz Capitulino <lcapitul...@redhat.com> > CC: Osier Yang <jy...@redhat.com> > CC: Anthony Liguori <aligu...@us.ibm.com> > --- > 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 <ebl...@redhat.com> > +## > +# @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 parameters > 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 exist. > +# > +# 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 > }, > > 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 exist. > + > +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'/ -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature