[PATCH 2/3] qemu_validate: Validate support for SCSI emulation support in 'virtio-blk' devices

Peter Krempa posted 3 patches 4 months ago
[PATCH 2/3] qemu_validate: Validate support for SCSI emulation support in 'virtio-blk' devices
Posted by Peter Krempa 4 months ago
The support will be dropped soon by qemu, and libvirt is not rejecting
such configurations. Add validation of this explicitly requested config.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_validate.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index fe190cea36..e69874801e 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -2912,6 +2912,11 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
             break;

         case VIR_DOMAIN_DISK_BUS_VIRTIO:
+            if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_BLK_SCSI)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("This QEMU doesn't support SCSI emulation with 'virtio-blk' device"));
+                return -1;
+            }
             break;

         case VIR_DOMAIN_DISK_BUS_NONE:
-- 
2.45.2