From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> Once we're in postcopy the source processors are stopped and memory shouldn't change any more, so there's no need to look at the dirty map.
There are two notes to this: 1) If we do resync and a page had changed then the page would get sent again, which the destination wouldn't allow (since it might have also modified the page) 2) Before disabling this I'd seen very rare cases where a page had been marked dirtied although the memory contents are apparently identical Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> --- arch_init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch_init.c b/arch_init.c index 0ba627b..1fe4fab 100644 --- a/arch_init.c +++ b/arch_init.c @@ -1381,7 +1381,10 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) static int ram_save_complete(QEMUFile *f, void *opaque) { qemu_mutex_lock_ramlist(); - migration_bitmap_sync(); + + if (!migration_postcopy_phase(migrate_get_current())) { + migration_bitmap_sync(); + } ram_control_before_iterate(f, RAM_CONTROL_FINISH); @@ -1414,7 +1417,8 @@ static uint64_t ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size) remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE; - if (remaining_size < max_size) { + if (!migration_postcopy_phase(migrate_get_current()) && + remaining_size < max_size) { qemu_mutex_lock_iothread(); migration_bitmap_sync(); qemu_mutex_unlock_iothread(); -- 1.9.3