]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Don't build cache= cmd line for scsi-block
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 28 May 2018 14:28:09 +0000 (16:28 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 28 May 2018 15:29:20 +0000 (17:29 +0200)
Trying to set any cache for <disk device='lun'/> makes no sense.
Such disk translates into -device scsi-block on the command line
and the device lacks any cache setting because it's merely a
middle man between qemu and real SCSI device.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c

index 7408f6bc70f98b2de0191fadf9e23e0654ad88e0..c7ff074e29167cb380052f55019de5b15a19de76 100644 (file)
@@ -1824,6 +1824,11 @@ qemuBuildDriveDevCacheStr(virDomainDiskDefPtr disk,
     if (disk->cachemode == VIR_DOMAIN_DISK_CACHE_DEFAULT)
         return 0;
 
+    /* VIR_DOMAIN_DISK_DEVICE_LUN translates into 'scsi-block'
+     * where any caching setting makes no sense. */
+    if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN)
+        return 0;
+
     if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISK_WRITE_CACHE))
         return 0;