qemu/hw/block
Paolo Bonzini ef5bc96268 virtio-blk: do not relay a previous driver's WCE configuration to the current
The following sequence happens:
- the SeaBIOS virtio-blk driver does not support the WCE feature, which
causes QEMU to disable writeback caching

- the Linux virtio-blk driver resets the device, finds WCE is available
but writeback caching is disabled; tells block layer to not send cache
flush commands

- the Linux virtio-blk driver sets the DRIVER_OK bit, which causes
writeback caching to be re-enabled, but the Linux virtio-blk driver does
not know of this side effect and cache flushes remain disabled

The bug is at the third step.  If the guest does know about CONFIG_WCE,
QEMU should ignore the WCE feature's state.  The guest will control the
cache mode solely using configuration space.  This change makes Linux
do flushes correctly, but Linux will keep SeaBIOS's writethrough mode.

Hence, whenever the guest is reset, the cache mode of the disk should
be reset to whatever was specified in the "-drive" option.  With this
change, the Linux virtio-blk driver finds that writeback caching is
enabled, and tells the block layer to send cache flush commands
appropriately.

Reported-by: Rusty Russell <rusty@au1.ibm.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-20 19:27:48 +02:00
..
dataplane dataplane: Fix startup race. 2013-09-06 15:25:09 +02:00
block.c
cdrom.c
ecc.c
fdc.c aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
hd-geometry.c
m25p80.c block/m25p80: Update Micron entries 2013-07-19 12:52:03 +04:00
Makefile.objs pc_sysfw: do not make it a device anymore 2013-08-12 09:31:14 -05:00
nand.c nand: Don't inherit from Sysbus 2013-06-25 19:15:46 +01:00
nvme.c aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
nvme.h NVMe: Initial commit for new storage interface 2013-06-17 17:47:59 +02:00
onenand.c onenand: QOM cast cleanup 2013-07-29 21:05:58 +02:00
pflash_cfi01.c aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
pflash_cfi02.c pflash_cfi02.c: fix debug macro 2013-09-01 19:32:42 +04:00
tc58128.c hw: move block devices to hw/block/, configure via default-configs/ 2013-04-08 18:13:13 +02:00
virtio-blk.c virtio-blk: do not relay a previous driver's WCE configuration to the current 2013-09-20 19:27:48 +02:00
xen_blkif.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
xen_disk.c block: Error parameter for open functions 2013-09-12 10:12:48 +02:00