On Fri 13 Nov 2020 12:49:04 PM CET, Max Reitz wrote: > On 11.11.20 17:53, Alberto Garcia wrote: >> This simply calls bdrv_co_pwrite_zeroes() in all children >> >> Signed-off-by: Alberto Garcia <be...@igalia.com> >> --- >> block/quorum.c | 18 ++++++++++++++++-- >> tests/qemu-iotests/312 | 7 +++++++ >> tests/qemu-iotests/312.out | 4 ++++ >> 3 files changed, 27 insertions(+), 2 deletions(-) > > Should we set supported_zero_flags to something? I think we can at > least set BDRV_REQ_NO_FALLBACK. We could also try BDRV_REQ_FUA.
We could set all supported_zero_flags as long as all children support them, right? >> + if (acb->flags & BDRV_REQ_ZERO_WRITE) { >> + sacb->ret = bdrv_co_pwrite_zeroes(s->children[i], acb->offset, >> + acb->bytes, acb->flags); >> + } else { >> + sacb->ret = bdrv_co_pwritev(s->children[i], acb->offset, acb->bytes, >> + acb->qiov, acb->flags); >> + } > > Seems unnecessary (bdrv_co_pwritev() can handle BDRV_REQ_ZERO_WRITE), > but perhaps it’s good to be explicit. pwrite_zeroes() does this additionaly: if (!(child->bs->open_flags & BDRV_O_UNMAP)) { flags &= ~BDRV_REQ_MAY_UNMAP; } Berto