[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] bugfix:migrate with block-dirty-bitmap (disk size is big enough)
From: |
liuhaiwei |
Subject: |
[PATCH] bugfix:migrate with block-dirty-bitmap (disk size is big enough) can't be finished |
Date: |
Sat, 10 Sep 2022 02:35:42 -0400 |
From: liuhaiwei <liuhaiwei@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 <liuhaiwei9699@126.com>
Signed-off-by: liuhaiwei <liuhaiwei@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
- [PATCH] bugfix:migrate with block-dirty-bitmap (disk size is big enough) can't be finished,
liuhaiwei <=