Paolo Bonzini <pbonz...@redhat.com> writes:

> On 09/06/2015 10:42, Markus Armbruster wrote:
>> Part 2: When to use it?
>> 
>> We use 'gen': false when we can't (be bothered to) specify the exact
>> type of an argument or result.
>> 
>> Bad example: netdev_add
>> 
>>     We have arguments 'type': 'str' and '*props': '**'.
>> 
>>     We should have a union tagged by network backend type.  For each
>>     type, the union holds the type's properties (if any).
>
> The problem with this is that netdev_add was not type safe, because it
> uses qemu_opts_from_qdict and QemuOpts is exclusively string-based.  So
> you could write 'port': '123' or 'port': 123, and both would work, the
> conversion to integer is done by the QemuOptsVisitor.
>
> Note that device_add would have the same problem.

Yes.

We can always start over with a new command and deprecate the old one.

Or we can add a backward-misfeature-compatible mode to QmpInputVisitor,
enabled only for the misfeatured commands.

Reply via email to