qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, stefanha@redhat.com, rjones@redhat.com,
	qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH v4 2/7] nbd: Add new qemu:allocation-depth metadata context
Date: Wed, 14 Oct 2020 14:52:41 +0300	[thread overview]
Message-ID: <85c7c5bf-a6cd-77d0-3dba-3e0df0e9570d@virtuozzo.com> (raw)
In-Reply-To: <20201009215533.1194742-3-eblake@redhat.com>

10.10.2020 00:55, Eric Blake wrote:
> 'qemu-img map' provides a way to determine which extents of an image
> come from the top layer vs. inherited from a backing chain.  This is
> useful information worth exposing over NBD.  There is a proposal to
> add a QMP command block-dirty-bitmap-populate which can create a dirty
> bitmap that reflects allocation information, at which point the
> qemu:dirty-bitmap:NAME metadata context can expose that information
> via the creation of a temporary bitmap, but we can shorten the effort
> by adding a new qemu:allocation-depth metadata context that does the
> same thing without an intermediate bitmap (this patch does not
> eliminate the need for that proposal, as it will have other uses as
> well).
> 
> For this patch, I just encoded a tri-state value (unallocated, from
> this layer, from any of the backing layers); an obvious extension
> would be to provide the actual depth in bits 31-4 while keeping bits
> 1-0 as a tri-state (leaving bits 3-2 unused, for ease of reading depth
> from a hex number).  But adding this extension would require
> bdrv_is_allocated_above to return a depth number.
> 
> While documenting things, remember that although the NBD protocol has
> NBD_OPT_SET_META_CONTEXT, the rest of its documentation refers to
> 'metadata context', which is a more apt description of what is
> actually being used by NBD_CMD_BLOCK_STATUS: the user is requesting
> metadata by passing one or more context names.  So I also touched up
> some existing wording to prefer the term 'metadata context' where it
> makes sense.
> 
> Note that this patch does not actually enable any way to request a
> server to enable this context; that will come in the next patch.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

> ---
>   docs/interop/nbd.txt | 27 ++++++++++---

[..]

> +In the allocation depth context, bits 0 and 1 form a tri-state value:
> +
> +    bits 0-1: 00: NBD_STATE_DEPTH_UNALLOC, the extent is unallocated
> +              01: NBD_STATE_DEPTH_LOCAL, the extent is allocated in the
> +                  top level of the image

Hmm. I always thought that "image" == file, so backing chain is a chain of images,
not a several levels of one image. If it is so, than it should be "the top level image".
And "levels of the image" may designate internal qcow2 snapshots unrelated here..


-- 
Best regards,
Vladimir


  reply	other threads:[~2020-10-14 11:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 21:55 [PATCH v4 0/7] Exposing backing-chain allocation over NBD Eric Blake
2020-10-09 21:55 ` [PATCH v4 1/7] nbd: Utilize QAPI_CLONE for type conversion Eric Blake
2020-10-14 11:15   ` Vladimir Sementsov-Ogievskiy
2020-10-23 16:15   ` Eric Blake
2020-10-09 21:55 ` [PATCH v4 2/7] nbd: Add new qemu:allocation-depth metadata context Eric Blake
2020-10-14 11:52   ` Vladimir Sementsov-Ogievskiy [this message]
2020-10-22 21:45     ` Eric Blake
2020-10-09 21:55 ` [PATCH v4 3/7] nbd: Add 'qemu-nbd -A' to expose allocation depth Eric Blake
2020-10-09 21:55 ` [PATCH v4 4/7] nbd: Update qapi to support exporting multiple bitmaps Eric Blake
2020-10-14 12:15   ` Vladimir Sementsov-Ogievskiy
2020-10-19 21:45     ` Eric Blake
2020-10-20  8:51       ` Markus Armbruster
2020-10-20 18:26         ` Eric Blake
2020-10-21  4:19           ` Markus Armbruster
2020-10-09 21:55 ` [PATCH v4 5/7] nbd: Simplify qemu bitmap context name Eric Blake
2020-10-14 12:21   ` Vladimir Sementsov-Ogievskiy
2020-10-09 21:55 ` [PATCH v4 6/7] nbd: Refactor counting of metadata contexts Eric Blake
2020-10-14 12:27   ` Vladimir Sementsov-Ogievskiy
2020-10-09 21:55 ` [PATCH v4 7/7] nbd: Allow export of multiple bitmaps for one device Eric Blake
2020-10-14 14:42   ` Vladimir Sementsov-Ogievskiy
2020-10-15 12:59     ` Eric Blake
     [not found] ` <20201016152318.80889-1-eblake@redhat.com>
2020-10-27 15:33   ` [Libguestfs] [libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth Eric Blake
2020-10-27 19:40     ` Richard W.M. Jones

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=85c7c5bf-a6cd-77d0-3dba-3e0df0e9570d@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=stefanha@redhat.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).