From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, Amos Kong <akong@redhat.com>
Cc: jyang@redhat.com, laine@redhat.com, libvir-list@redhat.com,
qemu-devel@nongnu.org, rjones@redhat.com, anthony@codemonkey.ws,
pbonzini@redhat.com, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH 5/5] query-command-line-options: return help message for legacy options
Date: Wed, 12 Feb 2014 13:48:45 -0700 [thread overview]
Message-ID: <52FBDE2D.5090505@redhat.com> (raw)
In-Reply-To: <87wqh1rge3.fsf@blackfin.pond.sub.org>
[-- Attachment #1: Type: text/plain, Size: 2947 bytes --]
On 02/11/2014 05:19 AM, Markus Armbruster wrote:
> [Note cc: Eric]
>
> Amos Kong <akong@redhat.com> writes:
>
>> Some legacy options that have arguments weren't added to
>> vm_config_groups[], so query-command-line-options returns a
>> NULL parameters infolist. This patch try to return help message
>> for this kind of legacy options.
>>
>> Example:
>> {
>> "helpmsg": "\"-vnc display start a VNC server on display\\n\"",
>> "parameters": [
>> ],
>> "option": "vnc"
>> },
>
> Do we have prospective users for this feature?
Libvirt probably won't care about helpmsg other than the fact that it
gets logged as part of the QMP reply, and the log is more legible if
human-readable text is included. I don't care if you add it or omit it;
the REAL change here is...
>> ##
>> { 'type': 'CommandLineOptionInfo',
>> - 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
>> + 'data': { 'option': 'str',
>> + '*parameters': ['CommandLineParameterInfo'],
changing parameters from mandatory to optional, and omitting it when
supplying information on an arg-less option. And that is what libvirt
wants, for learning about things like -enable-fips.
>> + '*helpmsg': 'str' } }
>>
>> ##
>> # @query-command-line-options:
>
> Aha, here's the schema change missing in PATCH 3/5.
Indeed; please resubmit the series so that every patch builds on its own.
>
> The schema needs to cover these kinds of options:
>
> 1. No argument
>
> { 'option': OPT-NAME }
This is newly allowed by your schema change.
>
> 2. QemuOpts argument
>
> 2a. with known parameters (QemuOptsList member desc[] not empty)
>
> { 'option': OPT-NAME,
> 'parameters': [ { 'name': PAR-NAME, 'type': PAR-TYPE }, ... ] }
Existing before your patch.
>
> 2b. with unknown parameters (desc[] empty)
>
> { 'option': OPT-NAME, parameters: [] }
Existing before your patch.
>
> 3. Other argument
>
> { 'option': OPT-NAME, ? }
>
> This patch adds 3. We need to decide what we want there.
>
> Any particular reason why we have to invent something new, and can't
> simply fold it into 2b?
Or even into 1? That is, the presence of 'parameters' is a witness of
whether a flag is boolean (-enable-fips) or takes arguments (-device);
then the length of the 'parameters' array is a witness of whether we
know all option arguments (modern code) or have unknown parameters
(older options that have not yet been converted to modern form).
>
> Note that I completely left out help strings, both on the option and on
> the parameter level. Both for brevity of presentation, and because I'd
> like to see a use before we add them.
Libvirt won't be hurt if you don't present help strings.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-02-12 20:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 3:53 [Qemu-devel] [PATCH 0/5] fix query-command-line-options Amos Kong
2014-01-28 3:53 ` [Qemu-devel] [PATCH 1/5] qmp: rename query_option_descs() to get_param_infolist() Amos Kong
2014-02-12 20:33 ` Eric Blake
2014-01-28 3:53 ` [Qemu-devel] [PATCH 2/5] introduce two marcos to dump the options info Amos Kong
2014-02-11 10:55 ` Markus Armbruster
2014-02-12 20:37 ` Eric Blake
2014-01-28 3:53 ` [Qemu-devel] [PATCH 3/5] query-command-line-options: query all the options in qemu-options.hx Amos Kong
2014-02-11 12:03 ` Markus Armbruster
2014-02-17 8:26 ` Amos Kong
2014-02-12 20:39 ` Eric Blake
2014-01-28 3:53 ` [Qemu-devel] [PATCH 4/5] introduce QEMU_OPTIONS_GENERATE_HELPMSG Amos Kong
2014-02-11 12:03 ` Markus Armbruster
2014-02-12 20:41 ` Eric Blake
2014-01-28 3:53 ` [Qemu-devel] [PATCH 5/5] query-command-line-options: return help message for legacy options Amos Kong
2014-02-11 12:19 ` Markus Armbruster
2014-02-12 20:48 ` Eric Blake [this message]
2014-02-17 8:49 ` Amos Kong
2014-02-12 21:00 ` Eric Blake
2014-02-17 8:56 ` Amos Kong
2014-02-10 20:26 ` [Qemu-devel] [PATCH 0/5] fix query-command-line-options Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52FBDE2D.5090505@redhat.com \
--to=eblake@redhat.com \
--cc=akong@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=armbru@redhat.com \
--cc=jyang@redhat.com \
--cc=laine@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).