Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- block.c | 5 +++++ block.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c index b682764..bb709c2 100644 --- a/block.c +++ b/block.c @@ -2369,6 +2369,11 @@ int bdrv_enable_write_cache(BlockDriverState *bs) return bs->enable_write_cache; } +void bdrv_set_enable_write_cache(BlockDriverState *bs, bool wce) +{ + bs->enable_write_cache = wce; +} + int bdrv_is_encrypted(BlockDriverState *bs) { if (bs->backing_hd && bs->backing_hd->encrypted) diff --git a/block.h b/block.h index 7408acc..eacdb7b 100644 --- a/block.h +++ b/block.h @@ -280,6 +280,7 @@ BlockErrorAction bdrv_get_on_error(BlockDriverState *bs, int is_read); int bdrv_is_read_only(BlockDriverState *bs); int bdrv_is_sg(BlockDriverState *bs); int bdrv_enable_write_cache(BlockDriverState *bs); +void bdrv_set_enable_write_cache(BlockDriverState *bs, bool wce); int bdrv_is_inserted(BlockDriverState *bs); int bdrv_media_changed(BlockDriverState *bs); void bdrv_lock_medium(BlockDriverState *bs, bool locked); -- 1.7.1