All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com,
	mreitz@redhat.com, jsnow@redhat.com
Subject: [Qemu-devel] [PATCH 5/5] block: Reject writethrough mode except at the root
Date: Mon, 14 Mar 2016 16:44:52 +0100	[thread overview]
Message-ID: <1457970292-12291-6-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1457970292-12291-1-git-send-email-kwolf@redhat.com>

Writethrough mode is going to become a BlockBackend feature rather than
a BDS one, so forbid it in places where we won't be able to support it
when the code finally matches the envisioned design.

We only allowed setting the cache mode of non-root nodes after the 2.5
release, so we're still free to make this change.

The target of block jobs is now always opened in a writeback mode
because it doesn't have a BlockBackend attached. This makes more sense
anyway because block jobs know when to flush. If the graph is modified
on job completion, the original cache mode moves to the new root, so
for the guest device writethough always stays enabled if it was
configured this way.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                    |  7 ++++
 blockdev.c                 | 19 ++++++++-
 tests/qemu-iotests/142     | 50 +++++++++++------------
 tests/qemu-iotests/142.out | 98 +++++++++-------------------------------------
 4 files changed, 68 insertions(+), 106 deletions(-)

diff --git a/block.c b/block.c
index 666fe61..94b8894 100644
--- a/block.c
+++ b/block.c
@@ -999,6 +999,13 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file,
 
     /* Apply cache mode options */
     update_flags_from_options(&bs->open_flags, opts);
+
+    if (!bs->blk && (bs->open_flags & BDRV_O_CACHE_WB) == 0) {
+        error_setg(errp, "Can't set writethrough mode except for the root");
+        ret = -EINVAL;
+        goto free_and_fail;
+    }
+
     bdrv_set_enable_write_cache(bs, bs->open_flags & BDRV_O_CACHE_WB);
 
     /* Open the image, either directly or using a protocol */
diff --git a/blockdev.c b/blockdev.c
index a22b444..9f36087 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1758,6 +1758,12 @@ static void external_snapshot_prepare(BlkActionState *common,
         flags |= BDRV_O_NO_BACKING;
     }
 
+    /* There is no BB attached during bdrv_open(), so we can't set a
+     * writethrough mode. bdrv_append() will swap the WCE setting so that the
+     * backing file becomes unconditionally writeback (which is what backing
+     * files should always be) and the new overlay gets the original setting. */
+    flags |= BDRV_O_CACHE_WB;
+
     assert(state->new_bs == NULL);
     ret = bdrv_open(&state->new_bs, new_image_file, snapshot_ref, options,
                     flags, errp);
@@ -2509,6 +2515,7 @@ void qmp_blockdev_change_medium(const char *device, const char *filename,
     BlockBackend *blk;
     BlockDriverState *medium_bs = NULL;
     int bdrv_flags, ret;
+    bool writethrough;
     QDict *options = NULL;
     Error *err = NULL;
 
@@ -2527,6 +2534,12 @@ void qmp_blockdev_change_medium(const char *device, const char *filename,
     bdrv_flags &= ~(BDRV_O_TEMPORARY | BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING |
         BDRV_O_PROTOCOL);
 
+    /* Must open the image in writeback mode as long as no BlockBackend is
+     * attached. The right mode can be set as the final step after changing the
+     * medium. */
+    writethrough = !(bdrv_flags & BDRV_O_CACHE_WB);
+    bdrv_flags |= BDRV_O_CACHE_WB;
+
     if (!has_read_only) {
         read_only = BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN;
     }
@@ -2584,6 +2597,8 @@ void qmp_blockdev_change_medium(const char *device, const char *filename,
         goto fail;
     }
 
+    bdrv_set_enable_write_cache(medium_bs, !writethrough);
+
     qmp_blockdev_close_tray(device, errp);
 
 fail:
@@ -3209,7 +3224,7 @@ static void do_drive_backup(const char *device, const char *target,
         goto out;
     }
 
-    flags = bs->open_flags | BDRV_O_RDWR;
+    flags = bs->open_flags | BDRV_O_CACHE_WB | BDRV_O_RDWR;
 
     /* See if we have a backing HD we can use to create our new image
      * on top of. */
@@ -3504,7 +3519,7 @@ void qmp_drive_mirror(const char *device, const char *target,
         format = mode == NEW_IMAGE_MODE_EXISTING ? NULL : bs->drv->format_name;
     }
 
-    flags = bs->open_flags | BDRV_O_RDWR;
+    flags = bs->open_flags | BDRV_O_CACHE_WB | BDRV_O_RDWR;
     source = backing_bs(bs);
     if (!source && sync == MIRROR_SYNC_MODE_TOP) {
         sync = MIRROR_SYNC_MODE_FULL;
diff --git a/tests/qemu-iotests/142 b/tests/qemu-iotests/142
index 8aa50f8..80834b5 100755
--- a/tests/qemu-iotests/142
+++ b/tests/qemu-iotests/142
@@ -96,36 +96,36 @@ function check_cache_all()
     # bs->backing
 
     echo -e "cache.direct=on on none0"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.direct=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.direct=on | grep -e "Cache" -e "[Cc]annot|[Cc]ould not|[Cc]an't"
     echo -e "\ncache.direct=on on file"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.direct=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.direct=on | grep -e "Cache" -e "[Cc]annot|[Cc]ould not|[Cc]an't"
     echo -e "\ncache.direct=on on backing"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.direct=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.direct=on | grep -e "Cache" -e "[Cc]annot|[Cc]ould not|[Cc]an't"
     echo -e "\ncache.direct=on on backing-file"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.direct=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.direct=on | grep -e "Cache" -e "[Cc]annot|[Cc]ould not|[Cc]an't"
 
     # cache.writeback is supposed to be inherited by bs->backing; bs->file
     # always gets cache.writeback=on
 
     echo -e "\n\ncache.writeback=off on none0"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.writeback=off | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.writeback=off | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.writeback=off on file"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.writeback=off | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.writeback=off | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.writeback=off on backing"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.writeback=off | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.writeback=off | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.writeback=off on backing-file"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.writeback=off | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.writeback=off | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
 
     # cache.no-flush is supposed to be inherited by both bs->file and bs->backing
 
     echo -e "\n\ncache.no-flush=on on none0"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.no-flush=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.no-flush=on | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.no-flush=on on file"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.no-flush=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.no-flush=on | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.no-flush=on on backing"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.no-flush=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.no-flush=on | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.no-flush=on on backing-file"
-    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.no-flush=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.no-flush=on | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
 }
 
 echo
@@ -218,7 +218,7 @@ info block image
 info block blkdebug
 info block file"
 
-echo "$hmp_cmds" | run_qemu -drive if=none,file="blkdebug::json:{\"filename\":\"$TEST_IMG\",,\"cache\":{\"writeback\":false,,\"direct\":false}}",node-name=image,file.node-name=blkdebug,file.image.node-name=file | grep "Cache"
+echo "$hmp_cmds" | run_qemu -drive if=none,file="blkdebug::json:{\"filename\":\"$TEST_IMG\",,\"cache\":{\"direct\":false}}",node-name=image,file.node-name=blkdebug,file.image.node-name=file | grep "Cache"
 
 echo
 echo "=== Check that referenced BDSes don't inherit ==="
@@ -234,35 +234,35 @@ function check_cache_all_separate()
     # Check cache.direct
 
     echo -e "cache.direct=on on blk"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.direct=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.direct=on | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.direct=on on file"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.direct=on -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.direct=on -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.direct=on on backing"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk",cache.direct=on -drive "$drv_file" -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk",cache.direct=on -drive "$drv_file" -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.direct=on on backing-file"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile",cache.direct=on -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile",cache.direct=on -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
 
     # Check cache.writeback
 
     echo -e "\n\ncache.writeback=off on blk"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.writeback=off | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.writeback=off | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.writeback=off on file"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.writeback=off -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.writeback=off -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.writeback=off on backing"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk",cache.writeback=off -drive "$drv_file" -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk",cache.writeback=off -drive "$drv_file" -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.writeback=off on backing-file"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile",cache.writeback=off -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile",cache.writeback=off -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
 
     # Check cache.no-flush
 
     echo -e "\n\ncache.no-flush=on on blk"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.no-flush=on | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.no-flush=on | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.no-flush=on on file"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.no-flush=on -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.no-flush=on -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.no-flush=on on backing"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk",cache.no-flush=on -drive "$drv_file" -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile" -drive "$drv_bk",cache.no-flush=on -drive "$drv_file" -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
     echo -e "\ncache.no-flush=on on backing-file"
-    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile",cache.no-flush=on -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img" | grep "Cache"
+    echo "$hmp_cmds" | run_qemu -drive "$drv_bkfile",cache.no-flush=on -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img" | grep -e "Cache" -e "[Cc]annot\|[Cc]ould not\|[Cc]an't"
 }
 
 echo
diff --git a/tests/qemu-iotests/142.out b/tests/qemu-iotests/142.out
index abe94c3..5dd5bd0 100644
--- a/tests/qemu-iotests/142.out
+++ b/tests/qemu-iotests/142.out
@@ -66,22 +66,13 @@ cache.writeback=off on none0
     Cache mode:       writeback
 
 cache.writeback=off on file
-    Cache mode:       writeback
-    Cache mode:       writethrough
-    Cache mode:       writeback
-    Cache mode:       writeback
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,file.cache.writeback=off: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writethrough
-    Cache mode:       writeback
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing-file
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writethrough
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.file.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 
 cache.no-flush=on on none0
@@ -147,25 +138,13 @@ cache.writeback=off on none0
     Cache mode:       writeback
 
 cache.writeback=off on file
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writethrough
-    Cache mode:       writeback
-    Cache mode:       writeback
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,file.cache.writeback=off: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writethrough
-    Cache mode:       writeback
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing-file
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writethrough
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.file.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 
 cache.no-flush=on on none0
@@ -230,22 +209,13 @@ cache.writeback=off on none0
     Cache mode:       writeback, direct
 
 cache.writeback=off on file
-    Cache mode:       writeback, direct
-    Cache mode:       writethrough, direct
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,file.cache.writeback=off: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
-    Cache mode:       writethrough, direct
-    Cache mode:       writeback, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing-file
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
-    Cache mode:       writethrough, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.file.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 
 cache.no-flush=on on none0
@@ -306,22 +276,13 @@ cache.writeback=off on none0
     Cache mode:       writeback, direct
 
 cache.writeback=off on file
-    Cache mode:       writeback, direct
-    Cache mode:       writethrough, direct
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,file.cache.writeback=off: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
-    Cache mode:       writethrough, direct
-    Cache mode:       writeback, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing-file
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
-    Cache mode:       writethrough, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.file.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 
 cache.no-flush=on on none0
@@ -387,25 +348,13 @@ cache.writeback=off on none0
     Cache mode:       writeback
 
 cache.writeback=off on file
-    Cache mode:       writeback, direct
-    Cache mode:       writeback
-    Cache mode:       writethrough
-    Cache mode:       writeback
-    Cache mode:       writeback
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,file.cache.writeback=off: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing
-    Cache mode:       writeback, direct
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writethrough
-    Cache mode:       writeback
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing-file
-    Cache mode:       writeback, direct
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writethrough
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.file.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 
 cache.no-flush=on on none0
@@ -440,7 +389,7 @@ cache.no-flush=on on backing-file
 
     Cache mode:       writethrough, direct, ignore flushes
     Cache mode:       writeback, direct, ignore flushes
-    Cache mode:       writethrough, ignore flushes
+    Cache mode:       writeback, ignore flushes
 
 === Check that referenced BDSes don't inherit ===
 
@@ -722,22 +671,13 @@ cache.writeback=off on none0
     Cache mode:       writeback, direct
 
 cache.writeback=off on file
-    Cache mode:       writeback
-    Cache mode:       writethrough
-    Cache mode:       writeback, direct
-    Cache mode:       writeback, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,file.cache.writeback=off: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writethrough, direct
-    Cache mode:       writeback, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 cache.writeback=off on backing-file
-    Cache mode:       writeback
-    Cache mode:       writeback
-    Cache mode:       writeback, direct
-    Cache mode:       writethrough, direct
+QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2,backing.file.filename=TEST_DIR/t.qcow2.base,node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,backing.file.cache.writeback=off: Could not open backing file: Can't set writethrough mode except for the root
 
 
 cache.no-flush=on on none0
-- 
1.8.3.1

  parent reply	other threads:[~2016-03-14 15:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14 15:44 [Qemu-devel] [PATCH 0/5] block: API changes for 2.6 Kevin Wolf
2016-03-14 15:44 ` [Qemu-devel] [PATCH 1/5] block: Remove copy-on-read from bdrv_move_feature_fields() Kevin Wolf
2016-03-14 15:51   ` Eric Blake
2016-03-14 15:44 ` [Qemu-devel] [PATCH 2/5] block: Remove dirty bitmaps " Kevin Wolf
2016-03-14 15:55   ` Eric Blake
2016-03-14 15:44 ` [Qemu-devel] [PATCH 3/5] block: Remove cache.writeback from blockdev-add Kevin Wolf
2016-03-14 16:10   ` Eric Blake
2016-03-14 16:22     ` Kevin Wolf
2016-03-14 15:44 ` [Qemu-devel] [PATCH 4/5] block: Make backing files always writeback Kevin Wolf
2016-03-14 16:46   ` Eric Blake
2016-03-14 15:44 ` Kevin Wolf [this message]
2016-03-14 16:50   ` [Qemu-devel] [PATCH 5/5] block: Reject writethrough mode except at the root Eric Blake
2016-03-18 17:10 ` [Qemu-devel] [PATCH 0/5] block: API changes for 2.6 Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457970292-12291-6-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.