Check whether the qemu binary supports the vdpa block driver. We can't
rely simply on the existence of the virtio-blk-vhost-vdpa block driver
since the first releases of qemu didn't support fd-passing for this
driver. So we have to check for the 'fdset' feature on the driver
object. This feature will be present in the qemu 8.1.0 release and was
merged to qemu in commit 98b126f5.
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index cf85d42198..11d5ecd622 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -693,6 +693,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
"virtio-gpu.blob", /* QEMU_CAPS_VIRTIO_GPU_BLOB */
"rbd-encryption-layering", /* QEMU_CAPS_RBD_ENCRYPTION_LAYERING
*/
"rbd-encryption-luks-any", /* QEMU_CAPS_RBD_ENCRYPTION_LUKS_ANY
*/
+ "virtio-blk-vhost-vdpa", /*
QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA */
);
@@ -1560,6 +1561,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] =
{
{ "object-add/arg-type/+iothread/thread-pool-max",
QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX },
{ "query-migrate/ret-type/blocked-reasons",
QEMU_CAPS_MIGRATION_BLOCKED_REASONS },
{ "screendump/arg-type/format/^png", QEMU_CAPS_SCREENSHOT_FORMAT_PNG },
+ { "blockdev-add/arg-type/+virtio-blk-vhost-vdpa/$fdset",
QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA},
};
typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 3b55aed07a..6feaa81bbf 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -672,6 +672,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check
*/
QEMU_CAPS_VIRTIO_GPU_BLOB, /* -device virtio-gpu-*.blob= */
QEMU_CAPS_RBD_ENCRYPTION_LAYERING, /* layered encryption support for Ceph RBD */
QEMU_CAPS_RBD_ENCRYPTION_LUKS_ANY, /* luks-any (LUKS and LUKS2) encryption format for
Ceph RBD */
+ QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA, /* -device virtio-blk-vhost-vdpa */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
--
2.40.1