From c83f9fba2a4ae3f07a7ac8ff8c021f539a08b6ce Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 3 Mar 2016 11:37:48 +0100 Subject: block/qapi: Use blk_enable_write_cache() Now that WCE is handled on the BlockBackend level, the flag is meaningless for BDSes. As the schema requires us to fill the field, we return an enabled write cache for them. Note that this means that querying the BlockBackend name may return writethrough as the cache information, whereas querying the node-name of the root of that same BlockBackend will return writeback. This may appear odd at first, but it actually makes sense because it correctly repesents the layer that implements the WCE handling. This becomes more apparent when you consider nodes that are the root node of multiple BlockBackends, where each BB can have its own WCE setting. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/142 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/qemu-iotests/142') diff --git a/tests/qemu-iotests/142 b/tests/qemu-iotests/142 index 517fb306c8..8bbbfde3a1 100755 --- a/tests/qemu-iotests/142 +++ b/tests/qemu-iotests/142 @@ -134,7 +134,8 @@ echo # First check the inherited cache mode after opening the image. -hmp_cmds="info block image +hmp_cmds="info block none0 +info block image info block file info block backing info block backing-file" @@ -164,6 +165,7 @@ echo # new cache mode is specified in the flags, not as an option. hmp_cmds='qemu-io none0 "reopen -c none" +info block none0 info block image info block file info block backing @@ -179,6 +181,7 @@ echo # new cache mode is specified as an option, not in the flags. hmp_cmds='qemu-io none0 "reopen -o cache.direct=on" +info block none0 info block image info block file info block backing @@ -214,6 +217,7 @@ echo # options from its parent node. hmp_cmds="qemu-io none0 \"reopen -o cache.writeback=off,cache.direct=on,cache.no-flush=on\" +info block none0 info block image info block blkdebug info block file" @@ -321,6 +325,7 @@ echo "--- Basic reopen ---" echo hmp_cmds='qemu-io none0 "reopen -o backing.cache.direct=on" +info block none0 info block image info block file info block backing -- cgit v1.2.3