qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Tao Xu <tao3.xu@intel.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH v3 1/2] quorum: Implement bdrv_co_block_status()
Date: Fri, 13 Nov 2020 12:36:56 +0100	[thread overview]
Message-ID: <6045ed83-ffa6-b5e8-e604-ce2140aef7ea@redhat.com> (raw)
In-Reply-To: <6b6256192945e7cacb9b0a9bf2b0db086d7f52e3.1605111801.git.berto@igalia.com>

On 11.11.20 17:53, Alberto Garcia wrote:
> The quorum driver does not implement bdrv_co_block_status() and
> because of that it always reports to contain data even if all its
> children are known to be empty.
> 
> One consequence of this is that if we for example create a quorum with
> a size of 10GB and we mirror it to a new image the operation will
> write 10GB of actual zeroes to the destination image wasting a lot of
> time and disk space.
> 
> Since a quorum has an arbitrary number of children of potentially
> different formats there is no way to report all possible allocation
> status flags in a way that makes sense, so this implementation only
> reports when a given region is known to contain zeroes
> (BDRV_BLOCK_ZERO) or not (BDRV_BLOCK_DATA).
> 
> If all children agree that a region contains zeroes then we can return
> BDRV_BLOCK_ZERO using the smallest size reported by the children
> (because all agree that a region of at least that size contains
> zeroes).
> 
> If at least one child disagrees we have to return BDRV_BLOCK_DATA.
> In this case we use the largest of the sizes reported by the children
> that didn't return BDRV_BLOCK_ZERO (because we know that there won't
> be an agreement for at least that size).
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> Tested-by: Tao Xu <tao3.xu@intel.com>
> ---
>   block/quorum.c             |  52 +++++++++++++
>   tests/qemu-iotests/312     | 148 +++++++++++++++++++++++++++++++++++++
>   tests/qemu-iotests/312.out |  67 +++++++++++++++++
>   tests/qemu-iotests/group   |   1 +
>   4 files changed, 268 insertions(+)
>   create mode 100755 tests/qemu-iotests/312
>   create mode 100644 tests/qemu-iotests/312.out

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



  reply	other threads:[~2020-11-13 11:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 16:53 [PATCH v3 0/2] quorum: Implement bdrv_co_block_status() Alberto Garcia
2020-11-11 16:53 ` [PATCH v3 1/2] " Alberto Garcia
2020-11-13 11:36   ` Max Reitz [this message]
2020-11-11 16:53 ` [PATCH v3 2/2] quorum: Implement bdrv_co_pwrite_zeroes() Alberto Garcia
2020-11-13 11:49   ` Max Reitz
2020-11-13 16:07     ` Alberto Garcia
2020-11-13 16:11       ` Max Reitz
2020-11-13 16:26         ` Alberto Garcia
2020-11-13 16:35           ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6045ed83-ffa6-b5e8-e604-ce2140aef7ea@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tao3.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).