]> Git Repo - qemu.git/commitdiff
migration: fix incorrect memory_global_dirty_log_start outside BQL
authorPaolo Bonzini <[email protected]>
Mon, 15 Feb 2016 18:57:57 +0000 (19:57 +0100)
committerPaolo Bonzini <[email protected]>
Tue, 16 Feb 2016 14:34:43 +0000 (15:34 +0100)
This can cause various segmentation faults or aborts in qemu-iotests
test 091.

Fixes: 5b82b703b69acc67b78b98a5efc897a3912719eb
Cc: Dave Gilbert <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
migration/ram.c

index 96c749face4f6b3290bfd28f4a1ef60da8c0dbc7..704f6a95bf12c3587b8dba9dfffe7bbe66f529d9 100644 (file)
@@ -1920,6 +1920,9 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
         acct_clear();
     }
 
+    /* For memory_global_dirty_log_start below.  */
+    qemu_mutex_lock_iothread();
+
     qemu_mutex_lock_ramlist();
     rcu_read_lock();
     bytes_transferred = 0;
@@ -1944,6 +1947,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
     memory_global_dirty_log_start();
     migration_bitmap_sync();
     qemu_mutex_unlock_ramlist();
+    qemu_mutex_unlock_iothread();
 
     qemu_put_be64(f, ram_bytes_total() | RAM_SAVE_FLAG_MEM_SIZE);
 
This page took 0.032587 seconds and 4 git commands to generate.