qemu: caps: Add lockout for -blockdev if QEMU_CAPS_SCSI_DISK_DEVICE_ID is not present

Avoid regressions by disallowing the BLOCKDEV capability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2019-01-28 17:12:01 +01:00
parent a1dce96236
commit 6d3c96f0d9

View File

@ -4331,6 +4331,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;