This duplicates a bit in open_flags, we do not need it. Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- block.c | 3 +-- block_int.h | 3 --- 2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/block.c b/block.c index 6734e66..4cf441b 100644 --- a/block.c +++ b/block.c @@ -604,7 +604,6 @@ static int bdrv_open_common(BlockDriverState *bs, const char *filename, bs->drv = drv; bs->opaque = g_malloc0(drv->instance_size); - bs->enable_write_cache = !!(flags & BDRV_O_CACHE_WB); bs->keep_read_only = bs->read_only = !(open_flags & BDRV_O_RDWR); /* Open the image, either directly or using a protocol */ @@ -2011,7 +2010,7 @@ int bdrv_is_sg(BlockDriverState *bs) int bdrv_enable_write_cache(BlockDriverState *bs) { - return bs->enable_write_cache; + return !!(bs->open_flags & BDRV_O_CACHE_WB); } int bdrv_is_encrypted(BlockDriverState *bs) diff --git a/block_int.h b/block_int.h index 311bd2a..f846f90 100644 --- a/block_int.h +++ b/block_int.h @@ -244,9 +244,6 @@ 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; -- 1.7.7.1