From: liuhaiwei <liuhai...@inspur.com>

bug description as  https://gitlab.com/qemu-project/qemu/-/issues/1203
Usually,we use the precopy or postcopy mode to migrate block dirty bitmap.
but if block-dirty-bitmap size more than threshold size,we cannot entry the 
migration_completion in migration_iteration_run function
To solve this problem, we can setting  the pending size to a fake 
value(threshold-1 or 0) to tell  migration_iteration_run function to entry the 
migration_completion,if pending size > threshold size

Signed-off-by: liuhaiwei <liuhaiwei9...@126.com>
Signed-off-by: liuhaiwei <liuhai...@inspur.com>
---
 migration/block-dirty-bitmap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 9aba7d9c22..5cbf365f46 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -782,6 +782,10 @@ static void dirty_bitmap_save_pending(QEMUFile *f, void 
*opaque,
     }
 
     qemu_mutex_unlock_iothread();
+     /*we set the fake pending size  when the dirty bitmap size more than 
max_size */
+    if(pending >= max_size && max_size != 0){
+        pending = max_size - 1;
+    }
 
     trace_dirty_bitmap_save_pending(pending, max_size);
 
-- 
2.27.0


Reply via email to