On 10/06/2016 10:30 AM, Kevin Wolf wrote:

>>> So, considering that it is a purely internally used type not visible in
>>> QMP, would it make sense to change NetLegacy to be a flat union instead,
>>> with NetLegacyOptions as the common base? Then you get the same flat
>>> namespace that we always had and that makes much more sense as an API.
>>
>> Changing that will impact on the QMP data structure, so I don't think
>> we can do that.
> 
> I don't see this type used in QMP at all. It's only used for command
> line parsing, and only with the OptsVisitor, so I think we're fine if we
> flatten it now.

In fact, in all my work to move netdev_add towards QAPI, I intentionally
special-cased NetLegacy to be unchanged, because it was not being used
by QMP at the time, and I didn't want any QMP changes to netdev to break
command line usage of NetLegacy.

We still have the annoying problem that my last patch for converting
netdev_add to QAPI didn't make 2.7, because we hadn't sorted out whether
we wanted to be able to handle back-compat of a user that requested "1"
vs. 1 (the QemuOpts code accepted either spelling, by virtue of the fact
that QDict to opts conversion rewrote the parsed QMP object into all
strings); and maybe this series solves that issue.  But the issue for
netdev_add (which IS visible to QMP) is slightly different than the
issue for NetLegacy (which does not have QMP ties other than using QAPI
to define a struct and glue code in net.c to map it back to normal
netdev code).

-- 
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