From: Peter Krempa Date: Thu, 30 Apr 2020 11:14:32 +0000 (+0200) Subject: qemu: capabilities: Introduce QEMU_CAPS_COMPAT_DEPRECATED X-Git-Tag: v7.3.0-rc1~370 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8793c6832dcc22ab63e843f6fb943de748a149f;p=thirdparty%2Flibvirt.git qemu: capabilities: Introduce QEMU_CAPS_COMPAT_DEPRECATED The capability is asserted if qemu supports the -compat deprecated-input= and deprecated-output= settings to control what should happen if deprecated fields are used in QMP. This will be used for a developer/tester-oriented setting which will aid us in catching use of deprecated settings sooner. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ea24e2d6a5..41ef199a79 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -625,6 +625,9 @@ VIR_ENUM_IMPL(virQEMUCaps, "blockdev-backup", "object.qapified", "rotation-rate", + + /* 400 */ + "compat-deprecated", ); @@ -5188,6 +5191,13 @@ virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps) if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI); + + /* The -compat qemu command line argument is implemented using a newer + * method which doesn't show up in query-command-line-options. As we'll use + * it only for development and testing purposes we can base the capability + * on a not entirely related witness. */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_QAPIFIED)) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_COMPAT_DEPRECATED); } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index a70c00a265..c553a5f4a4 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -606,6 +606,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_OBJECT_QAPIFIED, /* parameters for object-add are formally described */ QEMU_CAPS_ROTATION_RATE, /* scsi-disk / ide-drive rotation-rate prop */ + /* 400 */ + QEMU_CAPS_COMPAT_DEPRECATED, /* -compat deprecated-(input|output) is supported */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml index f260c60d5a..3a1e65ae44 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml @@ -261,6 +261,7 @@ + 5002050 0 43100242