This is based on top of
tests: qemu: Detect deprecation in the QMP schema (deprecation part 1)
https://www.redhat.com/archives/libvir-list/2020-April/msg01444.html
Both can be fetched at:
git fetch
https://gitlab.com/pipo.sk/libvirt.git netdev_add-validate
QEMU-5.0 released a fully QAPIfied 'netdev_add' command. Since we didn't
format the arguments in a way qemu now thinks we should do them network
device hotplug broke. Fix it by modifying our internals slightly and add
some testing.
This series also adds schema testing of -blockdev arguments and prepares
for a simple addition of schema testing for arguments of -device and
-object if qemu ever finishes the qapification of those. Theoretically
we can even do it pre-emtptively but it's almost guaranteed to fail at
least for -device. I just hope that qemu let's us know in advance as
-device will be harder.
Note that if the loading of the schema in the tests I've added will be
deemed to be slow I'll add caching.
Peter Krempa (21):
qemu: domain: Forbid unsupported 'tftp' protocol and handle tests
qemuMonitorJSONParseKeywords: remove constant argument
qemuBuildChannelsCommandLine: Use typecasted switch for channel type
qemuBuildChannelsCommandLine: Extract common formatting of 'chardev'
qemuBuildChannelChrDeviceStr: Remove formatting of properties for
-netdev
qemuBuildHostNetStr: Stop using 'ipv6-net' convenience argument
virQEMUBuildCommandLineJSON: Allow skipping certain keys
virQEMUBuildCommandLineJSON: Add possibility for using 'on/off'
instead of 'yes/no'
virCommand: Introduce virCommandGetArgList
util: json: Introduce virJSONValueObjectAppendStringPrintf
testCompareXMLToArgv: Split out preparation and command formatting
qemuMonitorJSON(Add|Remove)Netdev: Refactor cleanup
util: virqemu: Introduce virQEMUBuildNetdevCommandlineFromJSON
qemu: command: Generate -netdev command line via JSON->cmdline
conversion
virQEMUBuildNetdevCommandlineFromJSON: Prepare for quirky 'guestfwd'
qemuBuildChannelGuestfwdNetdevProps: Convert to generating JSON props
qemuMonitorAddNetdev: Convert to the native JSON props object
qemu: Prepare for testing of 'netdev_add' props via qemuxml2argvtest
testQEMUSchemaLoad: Rename to testQEMUSchemaLoadLatest
testutilsqemuschema: Allow loading non-latest schema
qemuxml2argvtest: Add QAPI/QMP schema validation for -blockdev and
-netdev
src/libvirt_private.syms | 3 +
src/qemu/qemu_command.c | 289 +++++++++++-------
src/qemu/qemu_command.h | 22 +-
src/qemu/qemu_domain.c | 10 +
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_hotplug.c | 31 +-
src/qemu/qemu_monitor.c | 8 +-
src/qemu/qemu_monitor.h | 2 +-
src/qemu/qemu_monitor_json.c | 76 ++---
src/qemu/qemu_monitor_json.h | 2 +-
src/qemu/qemu_process.c | 11 +-
src/qemu/qemu_process.h | 1 +
src/util/vircommand.c | 23 ++
src/util/vircommand.h | 1 +
src/util/virjson.c | 17 ++
src/util/virjson.h | 2 +
src/util/virqemu.c | 119 +++++++-
src/util/virqemu.h | 18 +-
tests/Makefile.am | 2 +-
tests/qemublocktest.c | 2 +-
tests/qemucommandutiltest.c | 2 +-
tests/qemuhotplugtest.c | 2 +-
tests/qemumonitorjsontest.c | 6 +-
.../qemuxml2argvdata/disk-cdrom-network.args | 3 -
.../disk-cdrom-network.x86_64-2.12.0.args | 3 -
.../disk-cdrom-network.x86_64-latest.args | 17 +-
tests/qemuxml2argvdata/disk-cdrom-network.xml | 9 -
tests/qemuxml2argvdata/net-user-addr.args | 3 +-
tests/qemuxml2argvtest.c | 236 +++++++++-----
tests/testutilsqemu.c | 5 +
tests/testutilsqemu.h | 1 +
tests/testutilsqemuschema.c | 66 ++--
tests/testutilsqemuschema.h | 5 +-
33 files changed, 667 insertions(+), 332 deletions(-)
--
2.26.2