migration: Fix migration state update issue
authorLiang Li <liang.z.li@intel.com>
Thu, 7 May 2015 18:31:22 +0000 (02:31 +0800)
committerJuan Quintela <quintela@redhat.com>
Thu, 7 May 2015 16:31:54 +0000 (18:31 +0200)
If live migration is very fast and can be completed in 1 second,
the dirty_sync_count of MigrationState will not be updated.
Then you will see "dirty sync count: 0" in qemu monitor even if
the actual dirty sync count is not 0.

Signed-off-by: Liang Li <liang.z.li@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr.David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
arch_init.c

index bbf0031019e0fe68e28e0fc43e884848e70f1bb0..23d3feba44ab960680b216a39afe53bd5a813b14 100644 (file)
@@ -744,8 +744,8 @@ static void migration_bitmap_sync(void)
         s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
         start_time = end_time;
         num_dirty_pages_period = 0;
-        s->dirty_sync_count = bitmap_sync_count;
     }
+    s->dirty_sync_count = bitmap_sync_count;
 }
 
 /**