diff mbox series

migrate block dirty bitmap: Fix the block dirty bitmap can't to migration_completion when pending size larger than threshold size

Message ID 20220908134236.541312-1-liuhaiwei9699@126.com
State New
Headers show
Series migrate block dirty bitmap: Fix the block dirty bitmap can't to migration_completion when pending size larger than threshold size | expand

Commit Message

liuhaiwei Sept. 8, 2022, 1:42 p.m. UTC
From: liuhaiwei <liuhaiwei@inspur.com>

1、dirty bitmap size big enough (such as 8MB) when block size 1T ;
2、we set the migrate speed or the bandwith is small enough(such as 4MB/s)
so we set the fake pending size when pending size > threshold size

Signed-off-by: liuhaiwei <liuhaiwei9699@126.com>
Signed-off-by: liuhaiwei <liuhaiwei@inspur.com>
---
 migration/block-dirty-bitmap.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 9aba7d9c22..40f5a1aaf9 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -782,7 +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);
 
     *res_postcopy_only += pending;