qemu: capabilities: Introduce QEMU_CAPS_BLOCKJOB_BACKING_MASK_PROTOCOL

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>
This commit is contained in:
Peter Krempa 2023-11-24 15:19:35 +01:00
parent 8c07850c18
commit c38b4e34c8
3 changed files with 11 additions and 0 deletions

View 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;
}

View 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;

View File

@ -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>