qemu/include/hw/virtio
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: sync virtio.c and vring.c virtqueue state 2013-07-19 12:29:21 +08:00
vhost-scsi.h vhost-scsi: new device supporting the tcm_vhost Linux kernel module 2013-04-19 16:18:11 +02:00
vhost.h vhost: Add vhost_commit callback for SeaBIOS ROM region re-mapping 2013-04-19 10:44:17 +02:00
virtio-9p.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
virtio-balloon.h virtio: fix broken aliases. 2013-04-15 10:22:04 -05:00
virtio-blk.h virtio-blk: do not relay a previous driver's WCE configuration to the current 2013-09-20 19:27:48 +02:00
virtio-bus.h virtio: Support transports which can specify the vring alignment 2013-07-19 12:58:46 +01:00
virtio-net.h virtio-net: add feature bit for any header s/g 2013-07-15 21:26:26 +03:00
virtio-rng.h virtio-rng: cleanup: use QOM casts. 2013-04-24 11:50:20 -05:00
virtio-scsi.h virtio-scsi: fix the command line compatibility. 2013-05-03 12:05:15 -05:00
virtio-serial.h virtio-console: Also throttle when less was written then requested 2013-04-16 11:52:09 +02:00
virtio.h virtio: clear signalled_used_valid when switching from dataplane 2013-08-12 12:19:04 +03:00