
On 5/15/20 10:27 AM, Peter Krempa wrote:
Allow reusing this for formatting of netdev_add arguments into -netdev. We need to be able to skip the 'type' property as it's used without the prefix.
Not quite true. In qemu's net/net.c, there is: QemuOptsList qemu_netdev_opts = { .name = "netdev", .implied_opt_name = "type", .head = QTAILQ_HEAD_INITIALIZER(qemu_netdev_opts.head), .desc = { /* * no elements => accept any params * validation will happen later */ { /* end of list */ } }, The handling of .implied_opt_name means that the following two commands are identical: qemu-kvm -netdev user,id=net0 qemu-kvm -netdev type=user,id=net0 So you don't have to specifically handle type= specially. That said, I don't see any problem in adding this special-casing.
Add infrastructure which allows skipping a certainly named property.
Maybe s/certainly/specifically/
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/util/virqemu.c | 30 +++++++++++++++++++++--------- src/util/virqemu.h | 10 +++++++--- tests/qemucommandutiltest.c | 2 +- 3 files changed, 29 insertions(+), 13 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org