10e1093325
Bigger notable changes: * Commit 1a30b0f5d7 ("block: .bdrv_open is non-coroutine and unlocked") broke the PVE backup patches, in particular setting up the backup dump block driver, because bdrv_new_open_driver() cannot be called from a coroutine. To fix it, bdrv_co_open() is used instead, and while it's a much more involved function, the result should be essentially the same. The only difference I noticed is that the BDRV_O_ALLOW_RDWR flag is also set in the resulting bds (block driver state), but that shouldn't hurt. Smaller notable changes: * aio_set_fd_handler() dropped its 'is_external' parameter stating that all callers now pass false in 60f782b6b7 ("aio: remove aio_disable_external() API"). The calls in the PVE patches also passed false, so just drop the parameter too. * global_state_store() does not have a return value anymore, so the user in the PVE savevm-async patch was adapted. For context, see c33f1829f8 ("migration: never fail in global_state_store()"). * Renames affecting the PVE savevm-async patch: migrate_use_block() -> migrate_block() and ram_counters -> mig_stats 9d4b1e5f22 ("migration: Move migrate_use_block() to options.c") aff3f6606d ("migration: Rename ram_counters to mig_stats") Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
49 lines
2.0 KiB
Diff
49 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Fiona Ebner <f.ebner@proxmox.com>
|
|
Date: Fri, 28 Jul 2023 10:47:48 +0200
|
|
Subject: [PATCH] migration/block-dirty-bitmap: fix loading bitmap when there
|
|
is an iothread
|
|
|
|
The bdrv_create_dirty_bitmap() function (which is also called by
|
|
bdrv_dirty_bitmap_create_successor()) uses bdrv_getlength(bs). This is
|
|
a wrapper around a coroutine, and thus uses bdrv_poll_co(). Polling
|
|
tries to release the AioContext which will trigger an assert() if it
|
|
hasn't been acquired before.
|
|
|
|
The issue does not happen for migration, because there we are in a
|
|
coroutine already, so the wrapper will just call bdrv_co_getlength()
|
|
directly without polling.
|
|
|
|
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
|
|
---
|
|
migration/block-dirty-bitmap.c | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
|
|
index 032fc5f405..e1ae3b7316 100644
|
|
--- a/migration/block-dirty-bitmap.c
|
|
+++ b/migration/block-dirty-bitmap.c
|
|
@@ -805,8 +805,11 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
|
|
"destination", bdrv_dirty_bitmap_name(s->bitmap));
|
|
return -EINVAL;
|
|
} else {
|
|
+ AioContext *ctx = bdrv_get_aio_context(s->bs);
|
|
+ aio_context_acquire(ctx);
|
|
s->bitmap = bdrv_create_dirty_bitmap(s->bs, granularity,
|
|
s->bitmap_name, &local_err);
|
|
+ aio_context_release(ctx);
|
|
if (!s->bitmap) {
|
|
error_report_err(local_err);
|
|
return -EINVAL;
|
|
@@ -833,7 +836,10 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
|
|
|
|
bdrv_disable_dirty_bitmap(s->bitmap);
|
|
if (flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED) {
|
|
+ AioContext *ctx = bdrv_get_aio_context(s->bs);
|
|
+ aio_context_acquire(ctx);
|
|
bdrv_dirty_bitmap_create_successor(s->bitmap, &local_err);
|
|
+ aio_context_release(ctx);
|
|
if (local_err) {
|
|
error_report_err(local_err);
|
|
return -EINVAL;
|