[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] This patch is to solve the problem that the bitmap file in m
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [PATCH] This patch is to solve the problem that the bitmap file in memory is lost after creating a snapshot |
Date: |
Tue, 20 Sep 2022 15:29:48 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 |
[Cc Eric and John]
On 9/20/22 05:47, Hongleilee wrote:
From: Hongleili Li (李红磊)-云数据中心集团 <lihonglei03@inspur.com>
Signed-off-by: Hongleili Li (李红磊)-云数据中心集团 <lihonglei03@inspur.com>
---
blockdev.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 9230888e34..a6b85d06b7 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1534,6 +1534,10 @@ static void external_snapshot_prepare(BlkActionState
*common,
state->new_bs = bdrv_open(new_image_file, snapshot_ref, options, flags,
errp);
+
+ state->new_bs->dirty_bitmaps = state->old_bs->dirty_bitmaps;
+ QLIST_INIT(&state->old_bs->dirty_bitmaps);
+
/* We will manually add the backing_hd field to the bs later */
if (!state->new_bs) {
goto out;
Hi Hongleili Li!
I understand your problem, but we can't change the behavior in that manner, as
it will break existing users.
Qemu don't move bitmaps to the new node automatically. Instead we have Bitmap
API: to move the bitmap from node A to node B, you need three QMP commands:
block-dirty-bitmap-add {node: B, name: bitmap0}
block-dirty-bitmap-merge {node: B, target: bitmap0, bitmaps: [{node: A, name:
bitmap0}]}
block-dirty-bitmap-remove {node: A, name: bitmap0}
(and you may run them in a QMP transaction, even together with
blockdev-snapshot)
Will it work for you?
--
Best regards,
Vladimir