[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/12] migration: block-dirty-bitmap: add missing qemu_mutex_lock_
From: |
Paolo Bonzini |
Subject: |
[PULL 06/12] migration: block-dirty-bitmap: add missing qemu_mutex_lock_iothread |
Date: |
Tue, 5 Oct 2021 18:44:02 +0200 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
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 <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20211005080751.3797161-2-eesposit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
migration/block-dirty-bitmap.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 35f5ef688d..9aba7d9c22 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -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;
}
--
2.31.1
- [PULL 11/12] target/xtensa: list cores in a text file, (continued)
- [PULL 11/12] target/xtensa: list cores in a text file, Paolo Bonzini, 2021/10/05
- [PULL 10/12] hexagon: use env keyword argument to pass PYTHONPATH, Paolo Bonzini, 2021/10/05
- [PULL 09/12] meson: switch minimum meson version to 0.58.2, minimum recommended to 0.59.2, Paolo Bonzini, 2021/10/05
- [PULL 12/12] meson: show library versions in the summary, Paolo Bonzini, 2021/10/05
- Re: [PULL 12/12] meson: show library versions in the summary, Philippe Mathieu-Daudé, 2021/10/06
- Re: [PULL 12/12] meson: show library versions in the summary, Richard Henderson, 2021/10/06
- Re: [PULL 12/12] meson: show library versions in the summary, Philippe Mathieu-Daudé, 2021/10/06
- Re: [PULL 12/12] meson: show library versions in the summary, Paolo Bonzini, 2021/10/06
- Re: [PULL 12/12] meson: show library versions in the summary, Philippe Mathieu-Daudé, 2021/10/06
- Re: [PULL 12/12] meson: show library versions in the summary, Paolo Bonzini, 2021/10/07
[PULL 06/12] migration: block-dirty-bitmap: add missing qemu_mutex_lock_iothread,
Paolo Bonzini <=
Re: [PULL 00/12] Misc changes for 2021-10-05, Richard Henderson, 2021/10/05