[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/31] block: Default to enabled write cache in blk_n
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 20/31] block: Default to enabled write cache in blk_new() |
Date: |
Wed, 25 May 2016 19:39:45 +0200 |
The existing users of the function are:
1. blk_new_open(), which already enabled the write cache
2. Some test cases that don't care about the setting
3. blockdev_init() for empty drives, where the cache mode is overridden
with the value from the options when a medium is inserted
Therefore, this patch doesn't change the current behaviour. It will be
convenient, however, for additional users of blk_new() (like block
jobs) if the most sensible WCE setting is the default.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block/block-backend.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index f9da1d1..c8b13f1 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -125,6 +125,8 @@ BlockBackend *blk_new(void)
blk = g_new0(BlockBackend, 1);
blk->refcnt = 1;
+ blk_set_enable_write_cache(blk, true);
+
qemu_co_queue_init(&blk->public.throttled_reqs[0]);
qemu_co_queue_init(&blk->public.throttled_reqs[1]);
@@ -160,7 +162,6 @@ BlockBackend *blk_new_open(const char *filename, const char
*reference,
return NULL;
}
- blk_set_enable_write_cache(blk, true);
blk->root = bdrv_root_attach_child(bs, "root", &child_root, blk);
return blk;
--
1.8.3.1
- [Qemu-devel] [PULL 01/31] block: Fix bdrv_next() memory leak, (continued)
- [Qemu-devel] [PULL 01/31] block: Fix bdrv_next() memory leak, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 03/31] block: Let bdrv_open_inherit() return the snapshot, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 06/31] block: Drop bdrv_new_root(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 08/31] block: Assert !bs->refcnt in bdrv_close(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 05/31] block: Drop blk_new_with_bs(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 09/31] block: Drop bdrv_parent_cb_...() from bdrv_close(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 04/31] tests: Drop BDS from test-throttle.c, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 10/31] block: Drop errp parameter from blk_new(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 13/31] block: Fix reconfiguring graph with drained nodes, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 11/31] block: Introduce bdrv_replace_child(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 20/31] block: Default to enabled write cache in blk_new(),
Kevin Wolf <=
- [Qemu-devel] [PULL 07/31] block: Make bdrv_open() return a BDS, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 14/31] block: Propagate .drained_begin/end callbacks, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 12/31] block: Make bdrv_drain() use bdrv_drained_begin/end(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 15/31] dma-helpers: change interface to byte-based, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 18/31] block: keep a list of block jobs, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 22/31] block: Make blk_co_preadv/pwritev() public, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 16/31] dma-helpers: change BlockBackend to opaque value in DMAIOFunc, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 19/31] block: Cancel jobs first in bdrv_close_all(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 17/31] block: Rename blk_write_zeroes(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 24/31] mirror: Allow target that already has a BlockBackend, Kevin Wolf, 2016/05/25