diff mbox series

[v5,02/15] blkverify: set supported write/zero flags

Message ID 1509551048-129830-3-git-send-email-anton.nefedov@virtuozzo.com
State New
Headers show
Series qcow2: space preallocation and COW improvements | expand

Commit Message

Anton Nefedov Nov. 1, 2017, 3:43 p.m. UTC
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
---
 block/blkverify.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Alberto Garcia Jan. 11, 2018, 2:17 p.m. UTC | #1
On Wed 01 Nov 2017 04:43:55 PM CET, Anton Nefedov wrote:
> Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto
diff mbox series

Patch

diff --git a/block/blkverify.c b/block/blkverify.c
index 06369f9..9ba65d0 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -140,6 +140,15 @@  static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
         goto fail;
     }
 
+    bs->supported_write_flags = BDRV_REQ_FUA &
+        bs->file->bs->supported_write_flags &
+        s->test_file->bs->supported_write_flags;
+
+    bs->supported_zero_flags =
+        (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) &
+        bs->file->bs->supported_zero_flags &
+        s->test_file->bs->supported_zero_flags;
+
     ret = 0;
 fail:
     qemu_opts_del(opts);