From patchwork Tue Jul 24 18:36:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [09/27] ram: introduce migration_bitmap_sync() Date: Tue, 24 Jul 2012 08:36:34 -0000 From: Juan Quintela X-Patchwork-Id: 173036 Message-Id: <1343155012-26316-10-git-send-email-quintela@redhat.com> To: qemu-devel@nongnu.org Helper that we use each time that we need to syncronize the migration bitmap with the other dirty bitmaps. Signed-off-by: Juan Quintela --- arch_init.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch_init.c b/arch_init.c index c49c321..d21b2a3 100644 --- a/arch_init.c +++ b/arch_init.c @@ -367,6 +367,12 @@ static inline void migration_bitmap_set_dirty(MemoryRegion *mr, int length) } } +static void migration_bitmap_sync(void) +{ + memory_global_sync_dirty_bitmap(get_system_memory()); +} + + /* * ram_save_block: Writes a page of memory to the stream f * @@ -631,7 +637,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) expected_time, migrate_max_downtime()); if (expected_time <= migrate_max_downtime()) { - memory_global_sync_dirty_bitmap(get_system_memory()); + migration_bitmap_sync(); expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth; return expected_time <= migrate_max_downtime(); @@ -641,7 +647,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) static int ram_save_complete(QEMUFile *f, void *opaque) { - memory_global_sync_dirty_bitmap(get_system_memory()); + migration_bitmap_sync(); qemu_mutex_lock_ramlist();