]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: command: Generate -netdev command line via JSON->cmdline conversion
authorPeter Krempa <pkrempa@redhat.com>
Thu, 14 May 2020 20:50:59 +0000 (22:50 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 20 May 2020 07:41:57 +0000 (09:41 +0200)
commitb6738ffc9f8be5a2a61236cd9bef7fd317982f01
treedf803a16bad13067ceaf197d5d50c076acfc9bff
parent486bfba8b2b9e003916072ecf21eeb1d629a718d
qemu: command: Generate -netdev command line via JSON->cmdline conversion

The 'netdev_add' command was recently formally described in qemu via the
QMP schema. This means that it also requires the arguments to be
properly formatted. Our current approach is to generate the command line
and then use qemuMonitorJSONKeywordStringToJSON to get the JSON
properties for the monitor. This will not work if we need to pass some
fields as numbers or booleans.

In this step we re-do internals of qemuBuildHostNetStr to format a JSON
object which is converted back via virQEMUBuildNetdevCommandlineFromJSON
to the equivalent command line. This will later allow fixing of the
monitor code to use the JSON object directly rather than rely on the
conversion.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_command.h
src/qemu/qemu_hotplug.c