]> git.proxmox.com Git - qemu.git/commit - block_int.h
block: add enable_write_cache flag
authorChristoph Hellwig <hch@lst.de>
Fri, 4 Sep 2009 17:01:15 +0000 (19:01 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 11 Sep 2009 15:19:46 +0000 (10:19 -0500)
commite900a7b748316b5b5a98e41dde36a0cb8e15be5f
treef41d52f388664258f5caa4a03645cb4409676065
parentb8193adbda922659ba290fd9fb6ee053ee191d70
block: add enable_write_cache flag

Add a enable_write_cache flag in the block driver state, and use it to
decide if we claim to have a volatile write cache that needs controlled
flushing from the guest.  The flag is off if cache=writethrough is
defined because O_DSYNC guarantees that every write goes to stable
storage, and it is on for cache=none and cache=writeback.

Both scsi-disk and ide now use the new flage, changing from their
defaults of always off (ide) or always on (scsi-disk).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block.c
block.h
block_int.h
hw/ide/core.c
hw/scsi-disk.c