提交 16782dc3 编写于 作者: M Michal Privoznik

qemu: Don't build cache= cmd line for scsi-block

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: NMichal Privoznik <mprivozn@redhat.com>
上级 75e7ab1e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册