summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-03-04 14:52:32 +0100
committerKevin Wolf <kwolf@redhat.com>2016-03-30 11:59:32 +0200
commitb8816a43865822883ffc9b506e6243c7d986561a (patch)
tree4fdf9fa912d75eac44a77bcf79c3eb51abc00e5f /block.c
parentaaa436f9982ebf3988c9a25661c96bca97b259b0 (diff)
downloadqemu-b8816a43865822883ffc9b506e6243c7d986561a.tar.gz
block: Make backing files always writeback
First of all, we're generally not writing to backing files, but when we do, it's in the context of block jobs which know very well when to flush the image. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block.c b/block.c
index c4dca31fb2..d050c4bb58 100644
--- a/block.c
+++ b/block.c
@@ -738,8 +738,9 @@ static void bdrv_backing_options(int *child_flags, QDict *child_options,
{
int flags = parent_flags;
- /* The cache mode is inherited unmodified for backing files */
- qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_WB);
+ /* The cache mode is inherited unmodified for backing files; except WCE,
+ * which is only applied on the top level (BlockBackend) */
+ qdict_set_default_str(child_options, BDRV_OPT_CACHE_WB, "on");
qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_DIRECT);
qdict_copy_default(child_options, parent_options, BDRV_OPT_CACHE_NO_FLUSH);