block: Make cache=unsafe flush to the OS
authorKevin Wolf <kwolf@redhat.com>
Thu, 10 Nov 2011 17:13:59 +0000 (18:13 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 11 Nov 2011 13:02:59 +0000 (14:02 +0100)
commit811de10540cbedb01be1e3ef3228c1fb073aa2d7
treee29039d09181ff4a234373d2f65342c32b5f5e12
parent43363f679a3c4c104912925928d88ddc8feeda53
block: Make cache=unsafe flush to the OS

cache=unsafe completely ignored bdrv_flush, because flushing the host disk
costs a lot of performance. However, this means that qcow2 images (and
potentially any other format) can lose data even after the guest has issued a
flush if the qemu process crashes/is killed. In case of a host crash, data loss
is certainly expected with cache=unsafe, but if just the qemu process dies this
is a bit too unsafe.

Now that we have two separate flush functions, we can choose to flush
everythign to the OS, but don't enforce that it's physically written to the
disk.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c