Eric Blake <[email protected]> writes: > We've had all the required pieces for doing a type-safe representation > of netdev_add as a flat union for quite some time now (since > 0e55c381f6 in v2.7.0, released in 2016), but did not make the final > switch to using it because of concern about whether a command-line > regression in accepting "1" in place of 1 for integer arguments would > be problematic. Back then, we did not have the deprecation cycle to > allow us to make progress. But now that we have waited so long, other > problems have crept in: for example, our desire to add > qemu-storage-daemon is hampered by the inability to express net > objects, and we are unable to introspect what we actually accept. > Additionally, our round-trip through QemuOpts silently eats any > argument that expands to an array, rendering dnssearch, hostfwd, and > guestfwd useless through QMP: > > {"execute": "netdev_add", "arguments": { "id": "netdev0", > "type": "user", "dnssearch": [ > { "str": "8.8.8.8" }, { "str": "8.8.4.4" } > ]}} > > So without further ado, let's turn on proper QAPI. netdev_add() was a > trivial wrapper around net_client_init(), which did a few steps prior > to calling net_client_init1(); with this patch, we now skip directly > to net_client_init1(). In addition to fixing array parameters, the > following additional differences occur: > > - {"execute": "netdev_add", "arguments": {"type": "help"}} > no longer attempts to print help to stdout and exit. Bug fix, broken > in 547203ead4 'net: List available netdevs with "-netdev help"', > v2.12.0. > > - {"execute": "netdev_add", "arguments': {... "ip6-net": "..." }} > no longer attempts to desugar the undocumented ip6-net magic string
s/ip6-net/ipv6-net/ two times. Will fix in my tree. > into the proper "ipv6-prefix" and "ipv6-prefixlen". Undocumented > misfeature, introduced in commit 7aac531ef2 "qapi-schema, qemu-options > & slirp: Adding Qemu options for IPv6 addresses", v2.6.0. [...]
