On 07/14/2016 08:39 AM, Daniel P. Berrange wrote: > On Thu, Jul 14, 2016 at 08:23:18AM -0600, Eric Blake wrote: >> On 07/14/2016 08:16 AM, Daniel P. Berrange wrote: >>> Add a qmp_mixed_input_visitor_new() method which returns >>> a QMP input visitor that accepts either strings or the >>> native data types.
Question: do we want to allow: "key":1 when the QAPI is written 'key':'str'? Your current patches allow the converse (allowing "key":"1" when the QAPI is written 'key':'int'). To allow native types to be consumed in mixed-mode where string is expected would require yet another method for deciding how to handle non-strings in v->visitor.type_str. Where it might be useful is in SocketAddress parsing, in particular where InetSocketAddress.port is currently 'str' but where it often takes an integer port number in addition to a string for a named port alias; callers currently have to pass a stringized integer, where mixed mode might make it easier to fudge things. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature