qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 2/2] quorum: Implement bdrv_co_pwrite_zeroes()


From: Max Reitz
Subject: Re: [PATCH v4 2/2] quorum: Implement bdrv_co_pwrite_zeroes()
Date: Fri, 13 Nov 2020 20:44:05 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

On 13.11.20 17:52, Alberto Garcia wrote:
This simply calls bdrv_co_pwrite_zeroes() in all children.

bs->supported_zero_flags is also set to the flags that are supported
by all children.

Signed-off-by: Alberto Garcia <berto@igalia.com>
---
  block/quorum.c             | 36 ++++++++++++++++++++++++++++++++++--
  tests/qemu-iotests/312     | 11 +++++++++++
  tests/qemu-iotests/312.out |  8 ++++++++
  3 files changed, 53 insertions(+), 2 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>

@@ -897,6 +910,21 @@ static QemuOptsList quorum_runtime_opts = {
      },
  };
+static void quorum_refresh_flags(BlockDriverState *bs)
+{
+    BDRVQuorumState *s = bs->opaque;
+    int i;
+
+    bs->supported_zero_flags =
+        BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK;
+
+    for (i = 0; i < s->num_children; i++) {
+        bs->supported_zero_flags &= s->children[i]->bs->supported_zero_flags;
+    }
+
+    bs->supported_zero_flags |= BDRV_REQ_WRITE_UNCHANGED;

This made me wonder whether it’s true when rewrite_corrupted is set. I think it is, because that only does something when reading from the children (i.e. not for write requests from parents, where this flag might be set).

Looking into quorum_child_perm(), quorum doesn’t take the WRITE permission on its children even if rewrite_corrupted is true. Hm... Something to look into.

Max

+}
+
  static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
                         Error **errp)
  {




reply via email to

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