qemu: Only allow 'raw' format for scsi-block using virtio-scsi

https://bugzilla.redhat.com/show_bug.cgi?id=1379196

Add check in qemuCheckDiskConfig for an invalid combination
of using the 'scsi' bus for a block 'lun' device and any disk
source format other than 'raw'.
This commit is contained in:
John Ferlan 2016-10-31 15:44:34 -04:00
parent bfdefc0f02
commit f694f3ff6b

View File

@ -1238,6 +1238,14 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk)
return -1;
}
if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI &&
disk->src->format != VIR_STORAGE_FILE_RAW) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("disk device 'lun' using target 'scsi' must use "
"'raw' format"));
return -1;
}
if (qemuDomainDefValidateDiskLunSource(disk->src) < 0)
return -1;