[PATCH 2/4] qemu: capabilities: Introduce QEMU_CAPS_BLOCKJOB_BACKING_MASK_PROTOCOL

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

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c                     | 7 +++++++
 src/qemu/qemu_capabilities.h                     | 3 +++
 tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 +
 3 files changed, 11 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f4b4f05479..e383d85920 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -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;
 }

diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 1b5130a1d3..486a4a6f63 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -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;

diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
index a1859fbf6d..7bf13da1db 100644
--- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
@@ -201,6 +201,7 @@
   <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>
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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