Skip to content

Commit 3c158eb

Browse files
esposembonzini
authored andcommitted
migration: block-dirty-bitmap: add missing qemu_mutex_lock_iothread
init_dirty_bitmap_migration assumes the iothread lock (BQL) to be held, but instead it isn't. Instead of adding the lock to qemu_savevm_state_setup(), follow the same pattern as the other ->save_setup callbacks and lock+unlock inside dirty_bitmap_save_setup(). Signed-off-by: Emanuele Giuseppe Esposito <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 4dba278 commit 3c158eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

migration/block-dirty-bitmap.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,15 +1215,18 @@ static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
12151215
{
12161216
DBMSaveState *s = &((DBMState *)opaque)->save;
12171217
SaveBitmapState *dbms = NULL;
1218+
1219+
qemu_mutex_lock_iothread();
12181220
if (init_dirty_bitmap_migration(s) < 0) {
1221+
qemu_mutex_unlock_iothread();
12191222
return -1;
12201223
}
12211224

12221225
QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
12231226
send_bitmap_start(f, s, dbms);
12241227
}
12251228
qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
1226-
1229+
qemu_mutex_unlock_iothread();
12271230
return 0;
12281231
}
12291232

0 commit comments

Comments
 (0)