diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-10-14 14:42:54 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-10-14 14:42:54 +0000 |
commit | 9f7965c7e965c8b80da27048017a360b3c57c4af (patch) | |
tree | 9a7b218b7a7b590fe926f1c282dfa0916f19092c /block.h | |
parent | eeb438c1b84468e8faa7e69bec86b78b45f2347f (diff) |
Expand cache= option and use write-through caching by default
This patch changes the cache= option to accept none, writeback, or writethough
to control the host page cache behavior. By default, writethrough caching is
now used which internally is implemented by using O_DSYNC to open the disk
images. When using -snapshot, writeback is used by default since data integrity
it not at all an issue.
cache=none has the same behavior as cache=off previously. The later syntax is
still supported by now deprecated. I also cleaned up the O_DIRECT
implementation to avoid many of the #ifdefs.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5485 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block.h')
-rw-r--r-- | block.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -47,7 +47,10 @@ typedef struct QEMUSnapshotInfo { use a disk image format on top of it (default for bdrv_file_open()) */ -#define BDRV_O_DIRECT 0x0020 +#define BDRV_O_NOCACHE 0x0020 /* do not use the host page cache */ +#define BDRV_O_CACHE_WB 0x0040 /* use write-back caching */ + +#define BDRV_O_CACHE_MASK (BDRV_O_NOCACHE | BDRV_O_CACHE_WB) void bdrv_info(void); void bdrv_info_stats(void); |