From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, John Snow <jsnow@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
qemu-block@nongnu.org (open list:Block Jobs)
Subject: Re: [PATCH 7/6] mirror: Allow QMP override to declare target already zero
Date: Sat, 12 Apr 2025 06:56:37 +0200 [thread overview]
Message-ID: <8734ee3rlm.fsf@pond.sub.org> (raw)
In-Reply-To: <20250411144845.600350-2-eblake@redhat.com> (Eric Blake's message of "Fri, 11 Apr 2025 09:48:22 -0500")
Eric Blake <eblake@redhat.com> writes:
> Qemu's attempts to learn whether a destination file starts life with
QEMU (multiple times).
> all zero contents are just a hueristic. There may be cases where the
heuristic
> caller is aware of information that qemu cannot learn quickly, in
> which case telling qemu what to assume about the destination can make
> the mirror operation faster. Given our existing example of "qemu-img
> convert --target-is-zero", it is time to expose this override in QMP
> for blockdev-mirror as well.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> qapi/block-core.json | 9 ++++++++-
> include/block/block_int-global-state.h | 3 ++-
> block/mirror.c | 19 +++++++++++++------
> blockdev.c | 18 +++++++++++-------
> tests/unit/test-block-iothread.c | 2 +-
> 5 files changed, 35 insertions(+), 16 deletions(-)
>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index b1937780e19..6d6185a336a 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -2538,6 +2538,12 @@
> # disappear from the query list without user intervention.
> # Defaults to true. (Since 3.1)
> #
> +# @target-is-zero: Assume the destination read as all zeroes before
reads
> +# the mirror started, even if qemu is unable to quickly learn that
QEMU
> +# from the destination. Default false, since setting this to true
> +# when the destination is not already zero can lead to a corrupt
> +# destination. (Since 9.1)
10.1
The "even if" clause is confusing. How would I decide that "QEMU is
unable to learn"?
According to the commit message, the purpose of the flag is to maybe
speed up things when we know the destination is all zeroes, but that's
less than obvious from the doc string.
> +#
Here's my attempt:
# @target-is-zero: Assume the destination read as all zeroes before
# the mirror started. Setting this to true can speed up the
# mirror. Setting this to true when the destination is not
# actually all zero can corrupt the destination. (Since 10.1)
> # Since: 2.6
> #
> # .. qmp-example::
> @@ -2557,7 +2563,8 @@
> '*on-target-error': 'BlockdevOnError',
> '*filter-node-name': 'str',
> '*copy-mode': 'MirrorCopyMode',
> - '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
> + '*auto-finalize': 'bool', '*auto-dismiss': 'bool',
> + '*target-is-zero': 'bool'},
> 'allow-preconfig': true }
>
> ##
[...]
next prev parent reply other threads:[~2025-04-12 5:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 1:04 [PATCH 0/6] Make blockdev-mirror dest sparse in more cases Eric Blake
2025-04-11 1:04 ` [PATCH 1/6] mirror: Skip pre-zeroing destination if it is already zero Eric Blake
2025-04-11 19:54 ` Vladimir Sementsov-Ogievskiy
2025-04-16 21:42 ` Eric Blake
2025-04-14 16:29 ` Vladimir Sementsov-Ogievskiy
2025-04-11 1:04 ` [PATCH 2/6] file-posix: Allow lseek at offset 0 when !want_zero Eric Blake
2025-04-14 17:05 ` Vladimir Sementsov-Ogievskiy
2025-04-14 18:12 ` Eric Blake
2025-04-15 12:37 ` Vladimir Sementsov-Ogievskiy
2025-04-15 15:22 ` Eric Blake
2025-04-15 16:11 ` Vladimir Sementsov-Ogievskiy
2025-04-11 1:04 ` [PATCH 3/6] mirror: Skip writing zeroes when target is already zero Eric Blake
2025-04-15 15:59 ` Vladimir Sementsov-Ogievskiy
2025-04-16 21:51 ` Eric Blake
2025-04-21 6:15 ` Vladimir Sementsov-Ogievskiy
2025-04-21 14:41 ` Eric Blake
2025-04-22 9:08 ` Vladimir Sementsov-Ogievskiy
2025-04-11 1:04 ` [PATCH 4/6] block: Expand block status mode from bool to enum Eric Blake
2025-04-11 1:04 ` [PATCH 5/6] file-posix: Recognize blockdev-create file as starting all zero Eric Blake
2025-04-11 1:04 ` [PATCH 6/6] tests: Add iotest mirror-sparse for recent patches Eric Blake
2025-04-11 14:48 ` [PATCH 7/6] mirror: Allow QMP override to declare target already zero Eric Blake
2025-04-12 4:56 ` Markus Armbruster [this message]
2025-04-11 20:15 ` [PATCH 0/6] Make blockdev-mirror dest sparse in more cases Eric Blake
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=8734ee3rlm.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.