mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
block: clarify the meaning of BDRV_O_NOCACHE
Change BDRV_O_NOCACHE to only imply bypassing the host OS file cache, but no writeback semantics. All existing callers are changed to also specify BDRV_O_CACHE_WB to give them writeback semantics. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
69c38b8fce
commit
a659979328
7 changed files with 13 additions and 19 deletions
8
block.c
8
block.c
|
@ -439,13 +439,7 @@ static int bdrv_open_common(BlockDriverState *bs, const char *filename,
|
|||
bs->drv = drv;
|
||||
bs->opaque = qemu_mallocz(drv->instance_size);
|
||||
|
||||
/*
|
||||
* Yes, BDRV_O_NOCACHE aka O_DIRECT means we have to present a
|
||||
* write cache to the guest. We do need the fdatasync to flush
|
||||
* out transactions for block allocations, and we maybe have a
|
||||
* volatile write cache in our backing device to deal with.
|
||||
*/
|
||||
if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE))
|
||||
if (flags & BDRV_O_CACHE_WB)
|
||||
bs->enable_write_cache = 1;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue