aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block.c5
-rw-r--r--tests/qemu-iotests/142.out10
2 files changed, 8 insertions, 7 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);
diff --git a/tests/qemu-iotests/142.out b/tests/qemu-iotests/142.out
index b555d5a255..abe94c3320 100644
--- a/tests/qemu-iotests/142.out
+++ b/tests/qemu-iotests/142.out
@@ -62,7 +62,7 @@ cache.direct=on on backing-file
cache.writeback=off on none0
Cache mode: writethrough
Cache mode: writeback
- Cache mode: writethrough
+ Cache mode: writeback
Cache mode: writeback
cache.writeback=off on file
@@ -143,7 +143,7 @@ cache.writeback=off on none0
Cache mode: writethrough
Cache mode: writethrough
Cache mode: writeback
- Cache mode: writethrough
+ Cache mode: writeback
Cache mode: writeback
cache.writeback=off on file
@@ -302,7 +302,7 @@ cache.direct=on on backing-file
cache.writeback=off on none0
Cache mode: writethrough, direct
Cache mode: writeback, direct
- Cache mode: writethrough, direct
+ Cache mode: writeback, direct
Cache mode: writeback, direct
cache.writeback=off on file
@@ -383,7 +383,7 @@ cache.writeback=off on none0
Cache mode: writeback, direct
Cache mode: writethrough
Cache mode: writeback
- Cache mode: writethrough
+ Cache mode: writeback
Cache mode: writeback
cache.writeback=off on file
@@ -718,7 +718,7 @@ cache.direct=on on backing-file
cache.writeback=off on none0
Cache mode: writethrough
Cache mode: writeback
- Cache mode: writethrough, direct
+ Cache mode: writeback, direct
Cache mode: writeback, direct
cache.writeback=off on file