From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: mreitz@redhat.com, kwolf@redhat.com, den@openvz.org,
pbonzini@redhat.com, armbru@redhat.com, jsnow@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/3] nbd/server: implement dirty bitmap export
Date: Wed, 18 Apr 2018 09:05:16 -0500 [thread overview]
Message-ID: <dc98f4cc-e863-2c1a-9729-a049229a40e6@redhat.com> (raw)
In-Reply-To: <20180413181401.46318-3-vsementsov@virtuozzo.com>
[-- Attachment #1: Type: text/plain, Size: 3054 bytes --]
On 04/13/2018 01:14 PM, Vladimir Sementsov-Ogievskiy wrote:
> Handle new NBD meta namespace: "qemu", and corresponding queries:
> "qemu:dirty-bitmap:<export bitmap name>".
>
> With new metadata context negotiated, BLOCK_STATUS query will reply
> with dirty-bitmap data, converted to extents. New public function
> nbd_export_bitmap selects bitmap to export. For now, only one bitmap
> may be exported.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> include/block/nbd.h | 6 ++
> nbd/server.c | 234 ++++++++++++++++++++++++++++++++++++++++++++++++----
> 2 files changed, 224 insertions(+), 16 deletions(-)
>
>
> +/* nbd_meta_bitmap_query
> + *
> + * Handle query to 'qemu-dirty-bitmap' namespace.
Stale comment
> + * 'len' is the amount of text remaining to be read from the current name, after
> + * the 'qemu-dirty-bitmap:' portion has been stripped.
and again
> + *
> + * Return -errno on I/O error, 0 if option was completely handled by
> + * sending a reply about inconsistent lengths, or 1 on success. */
> +static int nbd_meta_bitmap_query(NBDClient *client, NBDExportMetaContexts *meta,
> + uint32_t len, Error **errp)
> +{
> + if (!client->exp->export_bitmap) {
> + return nbd_opt_skip(client, len, errp);
> + }
> +
> + return nbd_meta_single_query(
> + client, client->exp->export_bitmap_context + strlen("qemu:"), len,
> + &meta->dirty_bitmap, errp);
Wait, so client->exp->export_bitmap_context is stored WITH the "qemu:"
prefix as part of the name?
During _LIST, you are allowing a query of "qemu:" to list all
qemu-specific contexts (namely, qemu:dirty-bitmap:<export-name>); but
should we also make it work that if you do "qemu:dirty-bitmap:", you get
a list of just dirty-bitmap contexts even if "qemu:" has added other
contexts in the meantime?
> @@ -1800,6 +1851,94 @@ static int nbd_co_send_block_status(NBDClient *client, uint64_t handle,
> return nbd_co_send_extents(client, handle, &extent, 1, context_id, errp);
> }
>
> +/* Set several extents, describing region of given @length with given @flags.
> + * Do not set more than @nb_extents, return number of set extents.
> + */
> +static unsigned add_extents(NBDExtent *extents, unsigned nb_extents,
> + uint64_t length, uint32_t flags)
> +{
> + unsigned i = 0;
> + uint32_t max_extent = QEMU_ALIGN_DOWN(INT32_MAX, 512);
> + /* TODO: should be somehow in agreement with blocksize of OPT_GO,
> + * and this should be documented in NBD proto. */
nbd.git commit 218c446 documented that descriptor lengths MUST be an
integer multiple of minimum block size; as for maximum, I see no reason
why BLOCK_STATUS can't report larger extents than what NBD_CMD_READ can
do. Do we need further doc tweaks to nbd.git?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2018-04-18 14:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 18:13 [Qemu-devel] [PATCH v2 0/3] NBD export bitmaps Vladimir Sementsov-Ogievskiy
2018-04-13 18:13 ` [Qemu-devel] [PATCH v2 1/3] nbd/server: add nbd_meta_single_query helper Vladimir Sementsov-Ogievskiy
2018-04-13 18:14 ` [Qemu-devel] [PATCH v2 2/3] nbd/server: implement dirty bitmap export Vladimir Sementsov-Ogievskiy
2018-04-18 14:05 ` Eric Blake [this message]
2018-04-19 8:31 ` Vladimir Sementsov-Ogievskiy
2018-04-13 18:14 ` [Qemu-devel] [PATCH v2 3/3] qapi: new qmp command nbd-server-add-bitmap Vladimir Sementsov-Ogievskiy
2018-04-30 21:22 ` [Qemu-devel] [PATCH v2 0/3] NBD export bitmaps 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=dc98f4cc-e863-2c1a-9729-a049229a40e6@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@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).