qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]