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(-)
@@ -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;