From: John Snow <jsnow@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: kwolf@redhat.com, ehabkost@redhat.com, mreitz@redhat.com,
crosa@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 1/4] qcow2-bitmap: add qcow2_reopen_bitmaps_rw_hint()
Date: Tue, 5 Dec 2017 18:00:10 -0500 [thread overview]
Message-ID: <a2f85b2d-783e-db97-2aa2-907ce170ff17@redhat.com> (raw)
In-Reply-To: <20171128071409.21887-2-vsementsov@virtuozzo.com>
On 11/28/2017 02:14 AM, Vladimir Sementsov-Ogievskiy wrote:
> Add version of qcow2_reopen_bitmaps_rw, which do the same work but
> also return a hint about was header updated or not. This will be
> used in the following fix for bitmaps reloading after migration.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block/qcow2.h | 2 ++
> block/qcow2-bitmap.c | 15 ++++++++++++++-
> 2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/block/qcow2.h b/block/qcow2.h
> index 6f0ff15dd0..40fa5b7cfe 100644
> --- a/block/qcow2.h
> +++ b/block/qcow2.h
> @@ -667,6 +667,8 @@ int qcow2_check_bitmaps_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
> void **refcount_table,
> int64_t *refcount_table_size);
> bool qcow2_load_autoloading_dirty_bitmaps(BlockDriverState *bs, Error **errp);
> +int qcow2_reopen_bitmaps_rw_hint(BlockDriverState *bs, bool *header_updated,
> + Error **errp);
> int qcow2_reopen_bitmaps_rw(BlockDriverState *bs, Error **errp);
> void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs, Error **errp);
> int qcow2_reopen_bitmaps_ro(BlockDriverState *bs, Error **errp);
> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
> index f45e46cfbd..6c80dcda69 100644
> --- a/block/qcow2-bitmap.c
> +++ b/block/qcow2-bitmap.c
> @@ -1002,7 +1002,8 @@ fail:
> return false;
> }
>
> -int qcow2_reopen_bitmaps_rw(BlockDriverState *bs, Error **errp)
> +int qcow2_reopen_bitmaps_rw_hint(BlockDriverState *bs, bool *header_updated,
> + Error **errp)
> {
> BDRVQcow2State *s = bs->opaque;
> Qcow2BitmapList *bm_list;
> @@ -1010,6 +1011,10 @@ int qcow2_reopen_bitmaps_rw(BlockDriverState *bs, Error **errp)
> GSList *ro_dirty_bitmaps = NULL;
> int ret = 0;
>
> + if (header_updated != NULL) {
> + *header_updated = false;
> + }
> +
> if (s->nb_bitmaps == 0) {
> /* No bitmaps - nothing to do */
> return 0;
> @@ -1053,6 +1058,9 @@ int qcow2_reopen_bitmaps_rw(BlockDriverState *bs, Error **errp)
> error_setg_errno(errp, -ret, "Can't update bitmap directory");
> goto out;
> }
> + if (header_updated != NULL) {
> + *header_updated = true;
> + }
> g_slist_foreach(ro_dirty_bitmaps, set_readonly_helper, false);
> }
>
> @@ -1063,6 +1071,11 @@ out:
> return ret;
> }
>
> +int qcow2_reopen_bitmaps_rw(BlockDriverState *bs, Error **errp)
> +{
> + return qcow2_reopen_bitmaps_rw_hint(bs, NULL, errp);
> +}
> +
> /* store_bitmap_data()
> * Store bitmap to image, filling bitmap table accordingly.
> */
>
Reviewed-by: John Snow <jsnow@redhat.com>
next prev parent reply other threads:[~2017-12-05 23:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 7:14 [Qemu-devel] [PATCH for 2.11 0/4] fix bitmaps migration through shared storage Vladimir Sementsov-Ogievskiy
2017-11-28 7:14 ` [Qemu-devel] [PATCH 1/4] qcow2-bitmap: add qcow2_reopen_bitmaps_rw_hint() Vladimir Sementsov-Ogievskiy
2017-12-05 23:00 ` John Snow [this message]
2017-11-28 7:14 ` [Qemu-devel] [PATCH 2/4] qcow2: handle reopening bitmaps on bdrv_invalidate_cache Vladimir Sementsov-Ogievskiy
2017-12-05 23:01 ` [Qemu-devel] [Qemu-block] " John Snow
2017-11-28 7:14 ` [Qemu-devel] [PATCH 3/4] scripts/qemu.py: tiny enhancement for event_wiat Vladimir Sementsov-Ogievskiy
2017-12-05 22:59 ` [Qemu-devel] [Qemu-block] " John Snow
2017-12-06 9:30 ` Vladimir Sementsov-Ogievskiy
2017-12-06 9:50 ` [Qemu-devel] " Vladimir Sementsov-Ogievskiy
2017-11-28 7:14 ` [Qemu-devel] [PATCH 4/4] iotests: add dirty bitmap migration test Vladimir Sementsov-Ogievskiy
2017-11-28 7:17 ` Vladimir Sementsov-Ogievskiy
2017-12-05 23:05 ` [Qemu-devel] [Qemu-block] " John Snow
2017-12-06 9:51 ` [Qemu-devel] " Vladimir Sementsov-Ogievskiy
2017-12-06 20:54 ` [Qemu-devel] [Qemu-block] " John Snow
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=a2f85b2d-783e-db97-2aa2-907ce170ff17@redhat.com \
--to=jsnow@redhat.com \
--cc=crosa@redhat.com \
--cc=den@openvz.org \
--cc=ehabkost@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@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).