From: Eric Blake <eblake@redhat.com>
To: Nir Soffer <nsoffer@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-block <qemu-block@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>,
Max Reitz <mreitz@redhat.com>,
libguestfs@redhat.com
Subject: Re: [PATCH 2/2] nbd: Add new qemu:joint-allocation metadata context
Date: Thu, 10 Jun 2021 09:04:00 -0500 [thread overview]
Message-ID: <20210610140400.s5bprikdunfkc5uh@redhat.com> (raw)
In-Reply-To: <CAMRbyys9kwJyg3AiowZwFg8uK1pHVPcKOJNckX0h0KUmNQZaMg@mail.gmail.com>
On Thu, Jun 10, 2021 at 04:16:27PM +0300, Nir Soffer wrote:
> On Thu, Jun 10, 2021 at 2:52 AM Nir Soffer <nsoffer@redhat.com> wrote:
> >
> > On Wed, Jun 9, 2021 at 9:01 PM Eric Blake <eblake@redhat.com> wrote:
>
> I posted a work in progress patch implementing support for
> qemu:joint-allocaition
> in oVirt:
> https://gerrit.ovirt.org/c/ovirt-imageio/+/115197
>
> The most important part is the nbd client:
> https://gerrit.ovirt.org/c/ovirt-imageio/+/115197/1/daemon/ovirt_imageio/_internal/nbd.py
>
> With this our tests pass with qemu-nbd build with Eric patch:
> https://gerrit.ovirt.org/c/ovirt-imageio/+/115197/1/daemon/test/client_test.py
Note that you _don't_ have to use qemu:joint-allocation; you could get
the same information by using the already-existing
qemu:allocation-depth. But your patch DOES make it obvious that it
was a lot simpler to use a single context (the bulk of your tweak is
trying an additional NBD_OPT_SET_META_CONTEXT), than it would be to
handle parallel contexts (where you would have to tweak your
NBD_CMD_BLOCK_STATUS handler to cross-correlate information).
>
> We may need to use qemu:joint-allocation only for qcow2 images, and
> base:allocation
> for raw images, because allocation depth reporting is not correct for
> raw images. Since
Allocation depth (aka how deep in the backing chain is data allocated)
IS correct for raw images (the raw image IS the source of all data);
it is just not useful.
> we control the qemu-nbd in both cases this should not be an issue. But
> it would be
> better if allocation depth would work for any kind of image, and we always use
> qemu:joint-allocation.
Maybe the thing to do is improve the documentation and try to avoid
ambiguous terminalogy; in qemu:allocation-depth, a return of depth 0
should be called "absent", not "unallocated". And in libnbd, a
base:allocation of 0 should be "data" or "normal", not "allocated".
But I don't see how qemu will ever advertise an allocation depth of 0
for a raw image, because raw images have no backing chain to defer to.
If you are trying to recreate a sparse raw image, then you really do
want to pay attention to NBD_STATE_HOLE and NBD_STATE_ZERO, as those
are more accurate pictures of the properties of extents within the raw
file.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2021-06-10 14:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 18:01 [RFC PATCH 0/2] New NBD metacontext Eric Blake
2021-06-09 18:01 ` [PATCH 1/2] iotests: Improve and rename test 309 to nbd-qemu-allocation Eric Blake
2021-06-10 12:14 ` Vladimir Sementsov-Ogievskiy
2021-06-09 18:01 ` [PATCH 2/2] nbd: Add new qemu:joint-allocation metadata context Eric Blake
2021-06-09 23:52 ` Nir Soffer
2021-06-10 12:30 ` Vladimir Sementsov-Ogievskiy
2021-06-10 13:47 ` Eric Blake
2021-06-10 14:10 ` Vladimir Sementsov-Ogievskiy
2021-06-10 13:16 ` Nir Soffer
2021-06-10 14:04 ` Eric Blake [this message]
2021-06-10 14:43 ` Vladimir Sementsov-Ogievskiy
2021-06-10 13:31 ` Eric Blake
2021-06-11 23:39 ` Nir Soffer
2021-06-14 13:56 ` Eric Blake
2021-06-14 14:06 ` Nir Soffer
2021-06-09 21:31 ` [RFC libnbd PATCH] info: Add support for new qemu:joint-allocation Eric Blake
2021-06-09 22:20 ` Nir Soffer
2021-06-10 13:06 ` Eric Blake
2021-06-10 13:19 ` Nir Soffer
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=20210610140400.s5bprikdunfkc5uh@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=libguestfs@redhat.com \
--cc=mreitz@redhat.com \
--cc=nsoffer@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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).