]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Assume QEMU_CAPS_DISK_WRITE_CACHE
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Nov 2022 07:40:07 +0000 (08:40 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Nov 2022 11:10:50 +0000 (12:10 +0100)
Introduced in QEMU's commit of v2.7.0-rc0~32^2~5 the .write-cache
attribute of virtio-blk dvice is always available for all QEMU
versions we support (4.2.0, currently). Therefore, we can assume
the capability is always set and thus doesn't need to be checked
for.

The change in some .args is justified, because the qemuxml2argvdatatest
runs these test caseses with very minimalistic set of capabilities,
that's nowhere near real life scenario.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
14 files changed:
src/qemu/qemu_command.c
tests/qemuxml2argvdata/controller-order.args
tests/qemuxml2argvdata/video-device-pciaddr-default.args
tests/qemuxml2argvdata/video-qxl-device-vgamem.args
tests/qemuxml2argvdata/video-qxl-device.args
tests/qemuxml2argvdata/video-qxl-sec-device-vgamem.args
tests/qemuxml2argvdata/video-qxl-sec-device.args
tests/qemuxml2argvdata/video-vga-device-vgamem.args
tests/qemuxml2argvdata/video-vga-device.args
tests/qemuxml2argvdata/video-virtio-gpu-device.args
tests/qemuxml2argvdata/video-virtio-gpu-sdl-gl.args
tests/qemuxml2argvdata/video-virtio-gpu-spice-gl.args
tests/qemuxml2argvdata/video-virtio-gpu-virgl.args
tests/qemuxml2argvdata/video-virtio-vga.args

index f775170e32ce14d788a0a02f3ab40a60882faf5c..3236196c14fce1276347416f64681c0acc5d73b8 100644 (file)
@@ -1900,8 +1900,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
     if (disk->cachemode != VIR_DOMAIN_DISK_CACHE_DEFAULT) {
         /* VIR_DOMAIN_DISK_DEVICE_LUN translates into 'scsi-block'
          * where any caching setting makes no sense. */
-        if (disk->device != VIR_DOMAIN_DISK_DEVICE_LUN &&
-            virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISK_WRITE_CACHE)) {
+        if (disk->device != VIR_DOMAIN_DISK_DEVICE_LUN) {
             bool wb;
 
             if (qemuDomainDiskCachemodeFlags(disk->cachemode, &wb, NULL,
index c0ba064becf9709fb4f1db880d9e6178a325cd94..242639591ca5d4910f7e2c7b8c7f0c1da4d232f4 100644 (file)
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-fdr/.config \
 -device usb-ccid,id=ccid0,bus=usb.0,port=1.1 \
 -blockdev '{"driver":"file","filename":"/tmp/fdr.img","aio":"native","node-name":"libvirt-2-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' \
--device virtio-blk-pci,bus=pci.0,addr=0x5,share-rw=on,drive=libvirt-2-format,id=virtio-disk0,bootindex=1 \
+-device virtio-blk-pci,bus=pci.0,addr=0x5,share-rw=on,drive=libvirt-2-format,id=virtio-disk0,bootindex=1,write-cache=on \
 -blockdev '{"driver":"file","filename":"/tmp/Fedora-17-x86_64-Live-Desktop.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"}' \
 -device ide-cd,bus=ide.1,unit=0,drive=libvirt-1-format,id=ide0-1-0 \
index e216aacc6444ae6a32b417fc629d46cae1e88f8d..9b421c012d50facbba1b21ea02224a0b9dc903a6 100644 (file)
@@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -vnc 127.0.0.1:0,audiodev=audio1 \
 -device qxl-vga,id=video0,max_outputs=1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x3 \
index 1332f798da659f9fea28803b0ab31c74126840f0..14b39311406e1307ec10844c74c0a6f0eb6e653f 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device qxl-vga,id=video0,max_outputs=1,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
index dc679b7aa5d5fc65b123192f2be3f52fcbd2c29d..570bb643238889ee54459b297c8f22e14c581238 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device qxl-vga,id=video0,max_outputs=1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
index 42de87528c8330f9ede1d15c14974e882c649572..1715ee0cf71c83a46d2af67f75aa1ab15e622667 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device qxl-vga,id=video0,max_outputs=1,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2 \
 -device qxl,id=video1,max_outputs=1,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x4 \
index c55e3eb9db3ee6d76e1e074393b61d7dd4375fc7..6140fffa7293b73ed86a792535326f6a24567d80 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device qxl-vga,id=video0,max_outputs=1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \
 -device qxl,id=video1,max_outputs=1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x4 \
index 8d1108216e883c05e11e62b21f9f5e8f4d161584..c9ac626b77cb1da962b47ea800d9b21b3b9f7423 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device VGA,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
index 1a832df4cbda36cbf523d1f1b86322c5ce6a70bc..10f3b38e0966231350db0061478ed19686d9ce41 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device VGA,id=video0,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
index 1dd818f5fc017c75999ba5db943fd9233cfb7ac4..2c316315726ad08eb6401823e4fc0431265d8f36 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device virtio-gpu-pci,id=video0,max_outputs=1,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
index d4ab9fac1632fb2b9f66c40001e7f490cf724bea..adeab6d53d6a9063711ed5b61ebbd16c55987b46 100644 (file)
@@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -display sdl,gl=on \
 -device virtio-gpu-pci,id=video0,virgl=on,max_outputs=1,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
index f198d4da8bb9032e450bdbf8e48c3fe0a0d591b7..60862a48d791c1d0144c4d91417514c045c7cac3 100644 (file)
@@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"spice"}' \
 -spice port=0,gl=on,rendernode=/dev/dri/foo,seamless-migration=on \
 -device virtio-gpu-pci,id=video0,virgl=on,max_outputs=1,bus=pci.0,addr=0x2 \
index 140bee618796dbcfed9b4abe240130295f382f62..87c79a4865db58687f6fb59ec2edfe1652af106d 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device virtio-gpu-pci,id=video0,virgl=on,max_outputs=1,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
index 704a6334b0127b8448a9b3d728744cb6c90be4f7..f0352d75831985382c226b518910f7b697e5a1fb 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -usb \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -device virtio-vga,id=video0,max_outputs=1,bus=pci.0,addr=0x2 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \