On 01/23/2018 05:28 AM, Anton Nefedov wrote: >>> + >>> +## >>> +# @BlockDriverStats: >>> +# >>> +# Statistics of a block driver (driver-specific) >>> +# >>> +# Since: 2.12 >>> +## >>> +{ 'union': 'BlockDriverStats', >>> + 'data': { >>> + 'file': 'BlockDriverStatsFile' >>> + } } >> >> Markus has been adamant that we add no new "simple unions" (unions with >> a 'discriminator' field) - because they are anything but simple in the >> long run.
> > Right, forgot about those unions.. Will fix. > > (I guess I will need an extra enum, like BlockdevDriverWithStats with a > single 'file' member, otherwise it seems to require to define data for > each BlockdevDriver type) Kevin also recently requested an easier way to make a flat union that uses only a subset of a larger enum. Maybe it's worth investing some time in a QAPI generator patch to make this part easier (I have a potential patch floating on one of my older branches that would allow 'branch':{} rather than having to declare a dummy type, but that's slightly different than not even supplying the branches that you aren't implementing). -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature