[PATCH 14/21] qemu: command: Generate -netdev command line via JSON->cmdline conversion

Eric Blake eblake at redhat.com
Mon May 18 15:20:57 UTC 2020


On 5/15/20 10:28 AM, Peter Krempa wrote:
> 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 at redhat.com>
> ---
>   src/qemu/qemu_command.c | 163 +++++++++++++++++++++++++---------------
>   src/qemu/qemu_command.h |  12 +--
>   src/qemu/qemu_hotplug.c |  13 +++-
>   3 files changed, 119 insertions(+), 69 deletions(-)
> 

Reviewed-by: Eric Blake <eblake at redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the libvir-list mailing list