]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: capabilities: Introduce QEMU_CAPS_BLOCKJOB_BACKING_MASK_PROTOCOL
authorPeter Krempa <pkrempa@redhat.com>
Fri, 24 Nov 2023 14:19:35 +0000 (15:19 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 2 Feb 2024 15:03:08 +0000 (16:03 +0100)
The capability is asserted when both block-stream and block-commit QMP
commands support the 'backing-mask-protocol' argument.

The argument causes qemu to record 'raw' as the backing file format in
case when a protocol node is used directly. This is needed to preserve
compatibility of images after a block-commit or block-pull libvirt
operation with older libvirt versions in case when we'll want to remove
the unneded 'raw' format drivers from the block graph.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml

index f4b4f05479f2fe7a93348e1f1ba83c12aae4d05e..e383d85920862c566dc8f3419abb656f57a9cb11 100644 (file)
@@ -701,6 +701,9 @@ VIR_ENUM_IMPL(virQEMUCaps,
               "virtio-blk.iothread-mapping", /* QEMU_CAPS_VIRTIO_BLK_IOTHREAD_MAPPING */
               "smp-clusters", /* QEMU_CAPS_SMP_CLUSTERS */
               "virtio-mem-pci.dynamic-memslots", /* QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS */
+
+              /* 455 */
+              "blockjob.backing-mask-protocol", /* QEMU_CAPS_BLOCKJOB_BACKING_MASK_PROTOCOL */
     );
 
 
@@ -5425,6 +5428,10 @@ virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCaps *qemuCaps,
             virQEMUCapsSet(qemuCaps, cmd->flag);
     }
 
+    if (virQEMUQAPISchemaPathExists("block-commit/arg-type/backing-mask-protocol", schema) &&
+        virQEMUQAPISchemaPathExists("block-stream/arg-type/backing-mask-protocol", schema))
+        virQEMUCapsSet(qemuCaps, QEMU_CAPS_BLOCKJOB_BACKING_MASK_PROTOCOL);
+
     return 0;
 }
 
index 1b5130a1d37eb9e337cb359508543638dfec3c9d..486a4a6f63de20a8a708fb2b6a1ab91d8690c284 100644 (file)
@@ -681,6 +681,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
     QEMU_CAPS_SMP_CLUSTERS, /* -smp clusters= */
     QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS, /* -device virtio-mem-pci.dynamic-memslots= */
 
+    /* 455 */
+    QEMU_CAPS_BLOCKJOB_BACKING_MASK_PROTOCOL, /* backing-mask-protocol of block-commit/block-stream */
+
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
 
index a1859fbf6d83a2821753315ea21e1174cb97aea1..7bf13da1db0138933a04657680071827a642cb65 100644 (file)
   <flag name='virtio-blk.iothread-mapping'/>
   <flag name='smp-clusters'/>
   <flag name='virtio-mem-pci.dynamic-memslots'/>
+  <flag name='blockjob.backing-mask-protocol'/>
   <version>8002050</version>
   <microcodeVersion>43100245</microcodeVersion>
   <package>v8.2.0-952-g14639717bf</package>