[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 16/17] qapi: Tweak QmpInputVisitor to optiona
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v9 16/17] qapi: Tweak QmpInputVisitor to optionally do string conversion |
Date: |
Thu, 14 Jul 2016 08:25:20 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 07/14/2016 08:16 AM, Daniel P. Berrange wrote:
> On Thu, Jul 14, 2016 at 08:04:29AM -0600, Eric Blake wrote:
>> On 07/14/2016 07:03 AM, Daniel P. Berrange wrote:
>>
>> 3 is a superset of 2, and your command-line conversion is the only case
>> where we can achieve 2. That is, code dealing with QMP can only choose
>> between 1 and 3, based on whether the QAPI .json file used
>> 'autocast':true for back-compat reasons (the only candidates are
>> 'netdev_add' and 'device_add'). And code dealing with command line
>> parsing can only choose 2 (QemuOpts is string-only), but parsing
>> string-only via 2 is no different than the result achieved from parsing
>> strongly-typed with string fallback via 3.
>>
>> I still don't buy the fact that we need a string-only parser at the
>> moment, but it would not be hard to change the 'bool autocast' into a
>> tri-state enum, and then make the implementation specifically honor 1,
>> 2, or 3 based on the enum value.
>
> FYI, I just copied you on a patch that enables us to easily support
> all 3 options.
Yours achieves that by having three separate constructors, instead of
one constructor with a tri-state enum parameter. Either approach works;
Markus, do you have any opinions on which looks nicer?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v9.5 11/17] block: Simplify drive-mirror, (continued)
[Qemu-devel] [PATCH v9 17/17] qapi: Restore autocast behavior in 'netdev_add', Eric Blake, 2016/07/13
[Qemu-devel] [PATCH v9 12/17] qapi: Change Netdev into a flat union, Eric Blake, 2016/07/13
Re: [Qemu-devel] [PATCH for-2.7 v9 00/17] qapi netdev_add introspection (post-introspection cleanups subset F), Markus Armbruster, 2016/07/14