[libvirt] [PATCH 32/32] qemu: caps: Add lockout for -blockdev if QEMU_CAPS_SCSI_DISK_DEVICE_ID is not present

Peter Krempa posted 32 patches 6 years, 10 months ago
There is a newer version of this series
[libvirt] [PATCH 32/32] qemu: caps: Add lockout for -blockdev if QEMU_CAPS_SCSI_DISK_DEVICE_ID is not present
Posted by Peter Krempa 6 years, 10 months ago
Avoid regressions by disallowing the BLOCKDEV capability.

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

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 4ed995d59f..09d48282a5 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4332,6 +4332,11 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
             virQEMUCapsClear(qemuCaps, QEMU_CAPS_SEV_GUEST);
     }

+    /* To avoid guest ABI regression, blockdev shall be enabled only when
+     * we are able to pass the custom 'device_id' for SCSI disks and cdroms. */
+    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_DISK_DEVICE_ID))
+        virQEMUCapsClear(qemuCaps, QEMU_CAPS_BLOCKDEV);
+
     ret = 0;
  cleanup:
     return ret;
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list