[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 14/40] block: Fix cache mode defaults in bds_tree_ini
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 14/40] block: Fix cache mode defaults in bds_tree_init() |
Date: |
Mon, 14 Mar 2016 18:37:15 +0100 |
Without setting explicit defaults in the options, blockdev-add without
an ID ended up defaulting to writethrough. It should be writeback as
documented.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
blockdev.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index eecd78d..1824cae 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -675,6 +675,13 @@ static BlockDriverState *bds_tree_init(QDict *bs_opts,
Error **errp)
goto fail;
}
+ /* bdrv_open() defaults to the values in bdrv_flags (for compatibility
+ * with other callers) rather than what we want as the real defaults.
+ * Apply the defaults here instead. */
+ qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_WB, "on");
+ qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_DIRECT, "off");
+ qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_NO_FLUSH, "off");
+
if (runstate_check(RUN_STATE_INMIGRATE)) {
bdrv_flags |= BDRV_O_INACTIVE;
}
--
1.8.3.1
- [Qemu-block] [PULL 03/40] block/qapi: Factor out bdrv_query_bds_stats(), (continued)
- [Qemu-block] [PULL 03/40] block/qapi: Factor out bdrv_query_bds_stats(), Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 05/40] block/vpc: choose size calculation method based on creator_app field, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 08/40] block/vpc: add tests for image creation force_size parameter, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 06/40] block/vpc: tests for auto-detecting VPC and Hyper-V VHD images, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 07/40] block/vpc: give option to force the current_size field in .bdrv_create, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 09/40] docs: fix invalid node name in qmp event, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 10/40] qmp event: Refactor QUORUM_REPORT_BAD, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 12/40] blockdev: Snapshotting must not open second instance of old top, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 11/40] quorum: modify vote rules for flush operation, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 13/40] block: Fix snapshot=on cache modes, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 14/40] block: Fix cache mode defaults in bds_tree_init(),
Kevin Wolf <=
- [Qemu-block] [PULL 15/40] vmdk: Switch to heap arrays for vmdk_write_cid, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 16/40] vmdk: Switch to heap arrays for vmdk_read_cid, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 17/40] vmdk: Switch to heap arrays for vmdk_parent_open, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 19/40] hmp: Extend drive_del to delete nodes without BB, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 22/40] parallels: Use BB functions in .bdrv_create(), Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 20/40] block: Use writeback in .bdrv_create() implementations, Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 21/40] block: Introduce blk_set_allow_write_beyond_eof(), Kevin Wolf, 2016/03/14
- [Qemu-block] [PULL 18/40] hmp: 'drive_add -n' for creating a node without BB, Kevin Wolf, 2016/03/14