Patchwork [v3,4/7] block: add bdrv_set_enable_write_cache

login
register
mail settings
Submitter Paolo Bonzini
Date June 5, 2012, 10:04 p.m.
Message ID <1338933895-20677-5-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/163184/
State New
Headers show

Comments

Paolo Bonzini - June 5, 2012, 10:04 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c |    5 +++++
 block.h |    1 +
 2 files changed, 6 insertions(+)

Patch

diff --git a/block.c b/block.c
index 9bff401..e4396a6 100644
--- a/block.c
+++ b/block.c
@@ -2380,6 +2380,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 574981d..43bfd99 100644
--- a/block.h
+++ b/block.h
@@ -291,6 +291,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);