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: <
20211005080751.
3797161[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
{
DBMSaveState *s = &((DBMState *)opaque)->save;
SaveBitmapState *dbms = NULL;
+
+ qemu_mutex_lock_iothread();
if (init_dirty_bitmap_migration(s) < 0) {
+ qemu_mutex_unlock_iothread();
return -1;
}
send_bitmap_start(f, s, dbms);
}
qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
-
+ qemu_mutex_unlock_iothread();
return 0;
}