On 05/08/2018 09:58 AM, Anton Nefedov wrote:
Signed-off-by: Anton Nefedov <[email protected]>
Reviewed-by: Alberto Garcia <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
---
block/blkverify.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/block/blkverify.c b/block/blkverify.c
index 754cc9e..496ae09 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -141,6 +141,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;
I wonder if it's worth the effort to support the flags if the main file
supports them natively but the test_file does not (and just emulate the
flag on the test file, in that situation). But for now, I'm fine with
your choice that both files must support a flag before the blkverify
layer claims the flag as well.
+
+ 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);
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org