diff options
author | Christoph Hellwig <hch@lst.de> | 2009-09-04 19:01:15 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-09-11 10:19:46 -0500 |
commit | e900a7b748316b5b5a98e41dde36a0cb8e15be5f (patch) | |
tree | f41d52f388664258f5caa4a03645cb4409676065 /block_int.h | |
parent | b8193adbda922659ba290fd9fb6ee053ee191d70 (diff) | |
download | qemu-e900a7b748316b5b5a98e41dde36a0cb8e15be5f.zip qemu-e900a7b748316b5b5a98e41dde36a0cb8e15be5f.tar.gz qemu-e900a7b748316b5b5a98e41dde36a0cb8e15be5f.tar.bz2 |
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>
Diffstat (limited to 'block_int.h')
-rw-r--r-- | block_int.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block_int.h b/block_int.h index 3e4b4a3..f95c80b 100644 --- a/block_int.h +++ b/block_int.h @@ -158,6 +158,9 @@ struct BlockDriverState { /* the memory alignment required for the buffers handled by this driver */ int buffer_alignment; + /* do we need to tell the quest if we have a volatile write cache? */ + int enable_write_cache; + /* NOTE: the following infos are only hints for real hardware drivers. They are not used by the block driver */ int cyls, heads, secs, translation; |