From bfd18d1e0b06608226fcef1982c3a439c49c3366 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 4 Mar 2016 14:28:01 +0100 Subject: block: Move enable_write_cache to BB level Whether a write cache is used or not is a decision that concerns the user (e.g. the guest device) rather than the backend. It was already logically part of the BB level as bdrv_move_feature_fields() always kept it on top of the BDS tree; with this patch, the core of it (the actual flag and the additional flushes) is also implemented there. Direct callers of bdrv_open() must pass BDRV_O_CACHE_WB now if bs doesn't have a BlockBackend attached. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- include/block/block.h | 1 + include/block/block_int.h | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/block/block.h b/include/block/block.h index 4fd6c050f0..ddfd50abd5 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -64,6 +64,7 @@ typedef enum { */ BDRV_REQ_MAY_UNMAP = 0x4, BDRV_REQ_NO_SERIALISING = 0x8, + BDRV_REQ_FUA = 0x10, } BdrvRequestFlags; typedef struct BlockSizes { diff --git a/include/block/block_int.h b/include/block/block_int.h index 1177c25aab..48846091ac 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -442,9 +442,6 @@ struct BlockDriverState { /* Alignment requirement for offset/length of I/O requests */ unsigned int request_alignment; - /* do we need to tell the quest if we have a volatile write cache? */ - int enable_write_cache; - /* the following member gives a name to every node on the bs graph. */ char node_name[32]; /* element of the list of named nodes building the graph */ -- cgit v1.2.3