diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-02-22 17:36:28 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2013-03-11 13:32:01 +0100 |
commit | 9b0950375277467fd74a9075624477ae43b9bb22 (patch) | |
tree | 32a7a3d94d8db23346accf8db5803a2bb508f020 /arch_init.c | |
parent | 32c835ba3984728c22d4e73cdb595090a60f437e (diff) | |
download | qemu-9b0950375277467fd74a9075624477ae43b9bb22.zip qemu-9b0950375277467fd74a9075624477ae43b9bb22.tar.gz qemu-9b0950375277467fd74a9075624477ae43b9bb22.tar.bz2 |
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.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch_init.c b/arch_init.c index 32b4378..6089c53 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); |