qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v9 2/9] blkverify: set supported write/zero flag


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH v9 2/9] blkverify: set supported write/zero flags
Date: Tue, 15 May 2018 09:37:35 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 05/08/2018 09:58 AM, Anton Nefedov wrote:
Signed-off-by: Anton Nefedov <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]