Re: [PATCH 2/6] qemu: capabilities: Introduce QEMU_CAPS_COMPAT_DEPRECATED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 19, 2021 at 07:33:50PM +0100, Peter Krempa wrote:
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 <pkrempa@xxxxxxxxxx>
---
src/qemu/qemu_capabilities.c                     | 8 ++++++++
src/qemu/qemu_capabilities.h                     | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml | 1 +
3 files changed, 10 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index dc1b10cd66..beea57caf6 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -624,6 +624,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
              "audiodev",
              "blockdev-backup",
              "object.qapified",
+              "compat-deprecated",
    );


@@ -5187,6 +5188,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);

Or it could be just enabled by default since it should be used by devs
and CI only.

}


diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index da51a788fa..a66a48a351 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -604,6 +604,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
    QEMU_CAPS_AUDIODEV, /* -audiodev instead of QEMU_AUDIO_DRV */
    QEMU_CAPS_BLOCKDEV_BACKUP, /* qemu supports the blockdev-backup job */
    QEMU_CAPS_OBJECT_QAPIFIED, /* parameters for object-add are formally described */
+    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 555b6b5317..458ae66719 100644
--- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml
@@ -260,6 +260,7 @@
  <flag name='audiodev'/>
  <flag name='blockdev-backup'/>
  <flag name='object.qapified'/>
+  <flag name='compat-deprecated'/>
  <version>5002050</version>
  <kvmVersion>0</kvmVersion>
  <microcodeVersion>43100242</microcodeVersion>
--
2.29.2

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux