]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Only allow 'raw' format for scsi-block using virtio-scsi
authorJohn Ferlan <jferlan@redhat.com>
Mon, 31 Oct 2016 19:44:34 +0000 (15:44 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 8 Nov 2016 11:32:12 +0000 (06:32 -0500)
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'.

src/qemu/qemu_command.c

index 96c4f31ccf0b2d5c2c08722279104530142524af..9adf0fe16ddf7ba5fad112c9cdd8321da292e249 100644 (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;