]> Git Repo - qemu.git/commitdiff
block: Make backing files always writeback
authorKevin Wolf <[email protected]>
Fri, 4 Mar 2016 13:52:32 +0000 (14:52 +0100)
committerKevin Wolf <[email protected]>
Wed, 30 Mar 2016 09:59:32 +0000 (11:59 +0200)
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 <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
block.c
tests/qemu-iotests/142.out

diff --git a/block.c b/block.c
index c4dca31fb2145ccf39b8b2d7f29531be8e2a2cde..d050c4bb5831fb8c5b1bb78cf4819038bb8183a3 100644 (file)
--- 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);
 
index b555d5a255b1569d33ab48b099ee10bf6e9139f1..abe94c3320bdbad9d61a29925adaee5a03a7dd1d 100644 (file)
@@ -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
This page took 0.036668 seconds and 4 git commands to generate.