
On 5/15/20 10:28 AM, Peter Krempa wrote:
QEMU models guestfwd as:
'guestfwd': [ { "str": "tcp:10.0.2.1:4600-chardev:charchannel0" }, { "str": "...."}, ]
I guess the original idea was to make it extensible while not worrying about adding another object for it. Either way it requires us to add yet another JSON->cmdline convertor for arrays.
I would have found it easier to mention both the JSON (which you did) and the corresponding CLI (which you did not): -netdev ...,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,guestfwd=... But the idea makes sense - the QMP form uses quite a bit of nesting (although actual qapfication of netdev occurred late, the hand-rolled parser for netdev predated many of the best practices learned for other interfaces, and the CLI does not reflect that nesting). Reviewed-by: Eric Blake <eblake@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org