From: Eric Blake <eblake@redhat.com>
To: Peter Krempa <pkrempa@redhat.com>, qemu-devel@nongnu.org
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-block@nongnu.org
Subject: Re: [PATCH v2 2/2] migration: dirty-bitmap: Allow control of bitmap persistance
Date: Fri, 12 Feb 2021 09:36:02 -0600 [thread overview]
Message-ID: <31c6da9d-221a-81f1-3f2d-8da3c8cd096c@redhat.com> (raw)
In-Reply-To: <e7bdfa1463cbcfc5a9458d98625f8b3dbe55a3b1.1612953419.git.pkrempa@redhat.com>
On 2/10/21 10:53 AM, Peter Krempa wrote:
> Bitmap's source persistance is transported over the migration stream and
persistence
> the destination mirrors it. In some cases the destination might want to
> persist bitmaps which are not persistent on the source (e.g. the result
> of merge of bitmaps from a number of layers on the source when migrating
> into a squashed image) but currently it would need to create another set
> of persistent bitmaps and merge them.
>
> This patch adds a 'transform' property to the alias map which allows to
> override the persistance of migrated bitmaps both on the source and
persistence
> destination sides.
>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>
> v2:
> - grammar fixes (Eric)
> - added 'transform' object to group other possible transformations (Vladimir)
> - transformation can also be used on source (Vladimir)
> - put bmap_inner directly into DBMLoadState for deduplication (Vladimir)
In addition to Vladimir's suggestion to use QAPI_CLONE() and an iotest
addition,
>
> migration/block-dirty-bitmap.c | 38 +++++++++++++++++++++++++++-------
> qapi/migration.json | 20 +++++++++++++++++-
> 2 files changed, 50 insertions(+), 8 deletions(-)
>
> diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
> index 0169f672df..a05bf74073 100644
> --- a/migration/block-dirty-bitmap.c
> +++ b/migration/block-dirty-bitmap.c
> @@ -138,6 +138,13 @@ typedef struct LoadBitmapState {
> bool enabled;
> } LoadBitmapState;
>
> +typedef struct AliasMapInnerBitmap {
> + char *string;
> +
> + /* 'transform' properties borrowed from QAPI */
> + BitmapMigrationBitmapAliasTransform *transform;
> +} AliasMapInnerBitmap;
> +
You moved this typedef up...
> /* State of the dirty bitmap migration (DBM) during load process */
> typedef struct DBMLoadState {
> uint32_t flags;
> @@ -148,6 +155,7 @@ typedef struct DBMLoadState {
> BdrvDirtyBitmap *bitmap;
>
> bool before_vm_start_handled; /* set in dirty_bitmap_mig_before_vm_start */
> + AliasMapInnerBitmap *bmap_inner;
>
> /*
> * cancelled
> @@ -169,10 +177,6 @@ typedef struct DBMState {
>
> static DBMState dbm_state;
>
> -typedef struct AliasMapInnerBitmap {
> - char *string;
> -} AliasMapInnerBitmap;
> -
...from here, although it was just added here in patch 1. Why not just
declare it up there in the first place in patch 1 to minimize the churn?
> +++ b/qapi/migration.json
> @@ -536,6 +536,20 @@
> 'data': [ 'none', 'zlib',
> { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
>
> +##
> +# @BitmapMigrationBitmapAliasTransform:
> +#
> +# @persistent: If present, the bitmap will be turned persistent
s/turned/made/ sounds a little nicer, although what you have wasn't wrong.
> +# or transient depending on this parameter.
> +# (since 6.0)
You don't need a '(since 6.0)' tag on the member, since...
> +#
> +# Since: 6.0
...the entire struct was introduced at the same time.
> +##
> +{ 'struct': 'BitmapMigrationBitmapAliasTransform',
> + 'data': {
> + '*persistent': 'bool'
> + } }
> +
> ##
> # @BitmapMigrationBitmapAlias:
> #
> @@ -544,12 +558,16 @@
> # @alias: An alias name for migration (for example the bitmap name on
> # the opposite site).
> #
> +# @transform: Allows to modify properties of the migrated bitmap.
> +# (since 6.0)
> +#
whereas this member tag is correct.
> # Since: 5.2
> ##
> { 'struct': 'BitmapMigrationBitmapAlias',
> 'data': {
> 'name': 'str',
> - 'alias': 'str'
> + 'alias': 'str',
> + '*transform': 'BitmapMigrationBitmapAliasTransform'
> } }
>
> ##
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
prev parent reply other threads:[~2021-02-12 15:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 16:53 [PATCH v2 0/2] migration: dirty-bitmap: Allow control of bitmap persistence Peter Krempa
2021-02-10 16:53 ` [PATCH v2 1/2] migration: dirty-bitmap: Convert alias map inner members to a struct Peter Krempa
2021-02-10 16:53 ` [PATCH v2 2/2] migration: dirty-bitmap: Allow control of bitmap persistance Peter Krempa
2021-02-11 16:04 ` Vladimir Sementsov-Ogievskiy
2021-02-12 15:36 ` Eric Blake [this message]
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=31c6da9d-221a-81f1-3f2d-8da3c8cd096c@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=pkrempa@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).