aboutsummaryrefslogtreecommitdiff
path: root/arch_init.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-02-22 17:36:28 +0100
committerJuan Quintela <quintela@redhat.com>2013-03-11 13:32:01 +0100
commit9b0950375277467fd74a9075624477ae43b9bb22 (patch)
tree32a7a3d94d8db23346accf8db5803a2bb508f020 /arch_init.c
parent32c835ba3984728c22d4e73cdb595090a60f437e (diff)
migration: run setup callbacks out of big lock
Only the migration_bitmap_sync() call needs the iothread lock. Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r--arch_init.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch_init.c b/arch_init.c
index 32b437897c..6089c53386 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -570,10 +570,6 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
bitmap_set(migration_bitmap, 0, ram_pages);
migration_dirty_pages = ram_pages;
- qemu_mutex_lock_ramlist();
- bytes_transferred = 0;
- reset_ram_globals();
-
if (migrate_use_xbzrle()) {
XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() /
TARGET_PAGE_SIZE,
@@ -587,8 +583,14 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
acct_clear();
}
+ qemu_mutex_lock_iothread();
+ qemu_mutex_lock_ramlist();
+ bytes_transferred = 0;
+ reset_ram_globals();
+
memory_global_dirty_log_start();
migration_bitmap_sync();
+ qemu_mutex_unlock_iothread();
qemu_put_be64(f, ram_bytes_total() | RAM_SAVE_FLAG_MEM_SIZE);