]> Git Repo - qemu.git/commitdiff
migration: block-dirty-bitmap: add missing qemu_mutex_lock_iothread
authorEmanuele Giuseppe Esposito <[email protected]>
Tue, 5 Oct 2021 08:07:50 +0000 (04:07 -0400)
committerPaolo Bonzini <[email protected]>
Tue, 5 Oct 2021 11:10:29 +0000 (13:10 +0200)
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]>
migration/block-dirty-bitmap.c

index 35f5ef688dc9ad3b5f220e2a6bbc26c028091884..9aba7d9c2200ef882c248ab72a0583057ee19327 100644 (file)
@@ -1215,7 +1215,10 @@ static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
 {
     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;
     }
 
@@ -1223,7 +1226,7 @@ static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
         send_bitmap_start(f, s, dbms);
     }
     qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
-
+    qemu_mutex_unlock_iothread();
     return 0;
 }
 
This page took 0.027959 seconds and 4 git commands to generate.