[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/12] block: Fix AioContext switch for drained node
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 09/12] block: Fix AioContext switch for drained node |
Date: |
Mon, 18 Feb 2019 17:18:19 +0100 |
When a drained node changes its AioContext, we need to move its
aio_disable_external() to the new context, too.
Without this fix, drain_end will try to reenable the new context, which
has never been disabled, so an assertion failure is triggered.
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/block.c b/block.c
index 17bc1d3dca..aefb5701f5 100644
--- a/block.c
+++ b/block.c
@@ -5227,6 +5227,9 @@ void bdrv_detach_aio_context(BlockDriverState *bs)
bdrv_detach_aio_context(child->bs);
}
+ if (bs->quiesce_counter) {
+ aio_enable_external(bs->aio_context);
+ }
bs->aio_context = NULL;
}
@@ -5240,6 +5243,10 @@ void bdrv_attach_aio_context(BlockDriverState *bs,
return;
}
+ if (bs->quiesce_counter) {
+ aio_disable_external(new_context);
+ }
+
bs->aio_context = new_context;
QLIST_FOREACH(child, &bs->children, next) {
--
2.20.1
[Qemu-devel] [PATCH 12/12] aio-posix: Assert that aio_poll() is always called in home thread, Kevin Wolf, 2019/02/18
[Qemu-devel] [PATCH 05/12] nbd: Move nbd_read_eof() to nbd/client.c, Kevin Wolf, 2019/02/18