From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Max Reitz" <mreitz@redhat.com>,
"Andreas Färber" <afaerber@suse.de>,
qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v14 01/21] option: make parse_option_bool/number non-static
Date: Fri, 21 Oct 2016 19:51:28 +0200 [thread overview]
Message-ID: <87k2d1egkf.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <4e94fe14-936b-12f2-9c68-245e3a0f7a58@redhat.com> (Eric Blake's message of "Fri, 21 Oct 2016 12:12:19 -0500")
Eric Blake <eblake@redhat.com> writes:
> On 10/21/2016 11:55 AM, Markus Armbruster wrote:
>
>>
>> On first glance, this patch makes the boolean values recognized on the
>> command line consistent regardless of which part of the code is used to
>> recognize them, by extending the QemuOpts parser to accept the option
>> visitor's additional convenience values.
>>
>> Once we've done that in a release, we can't go back. No problem if it
>> actually achieved consistency. But it doesn't: there are other parsers
>> that recognize only "on" and "off". A quick grep finds
>> select_display(), bdrv_open_inherit(), netfilter_set_status().
>
> Would it be wrong to convert these to use the same function, to get us
> to the point where they are consistent instead of self-limited? Yes, it
> means that newer qemu will accept spellings that older doesn't, and that
> we can't later prune the set of spellings back down, but trying to
> remain backwards-compatible to every different set of inputs on a
> command-by-command basis is harder than just making all commands accept
> all spellings.
I have two concerns:
1. Accepting alternate spellings in just a few places is slightly bad,
accepting them is most, but not all places is worse. Converting all the
parsers as you suggest would take care of this one.
>> bdrv_open_inherit() is particularly instructive: -drive gets parsed by
>> QemuOpts (evidence: your patch makes read-only=y work), but by the time
>> the options arrive here, they're a QDict. Curiously,
>> bdrv_open_inherit() expects the value of key "read-only" to be a
>> *string*, and it checks for "on". Fortunately, something on the way to
>> bdrv_open_inherit() replaces the "y" by "on", so this works. My point
>> is: this patch is trickier than it looks on first glance.
2. I'm scared some user of QemuOpts declares QEMU_OPT_BOOL, but then
checks the *string*. Yes, QemuOpts lets you do that. Making the parser
accept more strings would break such code. Need a careful code review
to put this concern to rest.
>> There's also HMP, which continues to accept only "on" and "off".
>
> Particularly for HMP, where we DON'T have backwards-compatibility
> constraints, I'd argue that ease-of-use is the driving factor and that
> HMP should allow ALL spellings of boolean arguments.
Personally, I find alternate spellings more confusing than helpful, but
I agree that once we adopt them for the command line (consistently, not
just in a few places), we should also adopt them for HMP.
>> We might want to treat the option visitor's additional boolean values
>> like its other syntax extensions: keep for compatibility, but confine
>> to existing uses.
>
> As in - new interfaces ONLY get to pass "true" or "false", and only
> existing interfaces get to also pass "y" or "on"?
Very few places accept anything but "on" and "off", namely the ones that
use the options or the string visitor. Dan's work kills of the former,
and hopefully permits us killing off the latter. The alternate
spellings will then be confined in one place, guarded by a compatibility
flag you're not supposed to set in new code. Looks workable to me.
>> I think we should decide that when we merge the rest of your option
>> visitor replacement work, hopefully in 2.9.
I'm not rejecting this patch, I'm merely punting the ABI-affecting parts
of this series to 2.9.
next prev parent reply other threads:[~2016-10-21 17:51 UTC|newest]
Thread overview: 109+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 14:45 [Qemu-devel] [PATCH v14 00/21] QAPI/QOM work for non-scalar object properties Daniel P. Berrange
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 01/21] option: make parse_option_bool/number non-static Daniel P. Berrange
2016-10-21 16:55 ` Markus Armbruster
2016-10-21 17:12 ` Eric Blake
2016-10-21 17:51 ` Markus Armbruster [this message]
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 02/21] qdict: implement a qdict_crumple method for un-flattening a dict Daniel P. Berrange
2016-10-18 14:32 ` Markus Armbruster
2016-10-20 14:11 ` Daniel P. Berrange
2016-10-21 9:58 ` Markus Armbruster
2016-10-21 18:31 ` Max Reitz
2016-10-24 9:18 ` Markus Armbruster
2016-10-24 10:28 ` Daniel P. Berrange
2016-10-24 12:38 ` Markus Armbruster
2016-10-25 10:03 ` Markus Armbruster
2016-10-25 10:20 ` Daniel P. Berrange
2016-10-25 12:29 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 03/21] qapi: add trace events for visitor Daniel P. Berrange
2016-09-30 15:49 ` Eric Blake
2016-10-06 14:39 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-10-07 13:59 ` [Qemu-devel] " Markus Armbruster
2016-10-07 14:16 ` Daniel P. Berrange
2016-10-21 10:52 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 04/21] qapi: rename QmpInputVisitor to QObjectInputVisitor Daniel P. Berrange
2016-10-25 13:41 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 05/21] qapi: rename QmpOutputVisitor to QObjectOutputVisitor Daniel P. Berrange
2016-10-25 13:36 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 06/21] qapi: don't pass two copies of TestInputVisitorData to tests Daniel P. Berrange
2016-09-30 17:43 ` Eric Blake
2016-10-06 14:39 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 07/21] qapi: permit scalar type conversions in QObjectInputVisitor Daniel P. Berrange
2016-09-30 17:48 ` Eric Blake
2016-10-11 16:20 ` Markus Armbruster
2016-10-12 14:51 ` Markus Armbruster
2016-10-12 15:05 ` Markus Armbruster
2016-10-12 15:26 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 08/21] qapi: allow QObjectInputVisitor to be created with QemuOpts Daniel P. Berrange
2016-09-30 17:55 ` Eric Blake
2016-10-06 14:56 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-10-12 8:08 ` [Qemu-devel] " Markus Armbruster
2016-10-13 7:23 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 09/21] qapi: permit auto-creating single element lists Daniel P. Berrange
2016-09-30 17:59 ` Eric Blake
2016-10-12 9:18 ` Markus Armbruster
2016-10-20 14:23 ` Daniel P. Berrange
2016-10-21 11:58 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 10/21] qapi: permit auto-creating nested structs Daniel P. Berrange
2016-09-30 18:23 ` Eric Blake
2016-10-06 15:10 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-10-06 15:18 ` Daniel P. Berrange
2016-10-06 15:30 ` Kevin Wolf
2016-10-06 15:39 ` Daniel P. Berrange
2016-10-06 15:51 ` Kevin Wolf
2016-10-06 15:57 ` Daniel P. Berrange
2016-10-12 14:00 ` Markus Armbruster
2016-10-06 17:54 ` Eric Blake
2016-10-12 14:12 ` [Qemu-devel] " Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 11/21] qapi: add integer range support for QObjectInputVisitor Daniel P. Berrange
2016-09-30 19:45 ` Eric Blake
2016-10-12 15:50 ` Markus Armbruster
2016-10-12 16:03 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-10-12 18:14 ` Markus Armbruster
2016-10-20 14:28 ` [Qemu-devel] " Daniel P. Berrange
2016-10-21 10:58 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 12/21] option: allow qemu_opts_to_qdict to merge repeated options Daniel P. Berrange
2016-09-30 20:08 ` Eric Blake
2016-10-12 17:46 ` Markus Armbruster
2016-10-13 9:21 ` Markus Armbruster
2016-10-20 14:29 ` Daniel P. Berrange
2016-10-21 11:09 ` Markus Armbruster
2016-10-21 11:14 ` Daniel P. Berrange
2016-10-13 8:31 ` Markus Armbruster
2016-10-20 14:37 ` Daniel P. Berrange
2016-10-21 11:28 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 13/21] qdict: allow qdict_crumple to accept compound types as values Daniel P. Berrange
2016-10-13 12:35 ` Markus Armbruster
2016-10-13 14:46 ` Kevin Wolf
2016-10-17 14:50 ` Markus Armbruster
2016-10-17 15:43 ` Paolo Bonzini
2016-10-17 17:48 ` Markus Armbruster
2016-10-17 17:38 ` Eric Blake
2016-10-18 10:59 ` Markus Armbruster
2016-10-18 9:34 ` Kevin Wolf
2016-10-18 15:35 ` Markus Armbruster
2016-10-19 9:25 ` Kevin Wolf
2016-10-19 9:42 ` Daniel P. Berrange
2016-10-19 13:31 ` [Qemu-devel] [Qemu-block] " Eric Blake
2016-10-20 14:46 ` [Qemu-devel] " Daniel P. Berrange
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 14/21] qapi: allow repeated opts with qobject_input_visitor_new_opts Daniel P. Berrange
2016-10-18 17:13 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 15/21] qom: support non-scalar properties with -object Daniel P. Berrange
2016-10-19 16:54 ` Markus Armbruster
2017-07-10 19:30 ` Manos Pitsidianakis
2017-07-11 8:10 ` Markus Armbruster
2017-07-11 14:44 ` Markus Armbruster
2017-07-11 14:49 ` Daniel P. Berrange
2017-07-12 17:56 ` Manos Pitsidianakis
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 16/21] hmp: support non-scalar properties with object_add Daniel P. Berrange
2016-10-20 6:43 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 17/21] numa: convert to use QObjectInputVisitor for -numa Daniel P. Berrange
2016-10-20 6:57 ` Markus Armbruster
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 18/21] block: convert crypto driver to use QObjectInputVisitor Daniel P. Berrange
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 19/21] acpi: convert to QObjectInputVisitor for -acpi parsing Daniel P. Berrange
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 20/21] net: convert to QObjectInputVisitor for -net/-netdev parsing Daniel P. Berrange
2016-10-20 7:38 ` Markus Armbruster
2016-10-20 13:43 ` [Qemu-devel] [Qemu-block] " Eric Blake
2016-09-30 14:45 ` [Qemu-devel] [PATCH v14 21/21] qapi: delete unused OptsVisitor code Daniel P. Berrange
2016-09-30 15:45 ` [Qemu-devel] [PATCH v14 00/21] QAPI/QOM work for non-scalar object properties no-reply
2016-09-30 18:50 ` Eric Blake
2016-10-21 18:30 ` Markus Armbruster
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=87k2d1egkf.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=afaerber@suse.de \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.