diff options
| author | Kevin Wolf | 2019-02-08 16:51:17 +0100 |
|---|---|---|
| committer | Kevin Wolf | 2019-02-25 15:03:19 +0100 |
| commit | e64f25f30b80a71bd4e409ed518c39eeb5905166 (patch) | |
| tree | a1805dc1b40dc182433dd6b1a6ae46e66ed00f7f | |
| parent | block: Don't poll in bdrv_set_aio_context() (diff) | |
| download | qemu-e64f25f30b80a71bd4e409ed518c39eeb5905166.tar.gz qemu-e64f25f30b80a71bd4e409ed518c39eeb5905166.tar.xz qemu-e64f25f30b80a71bd4e409ed518c39eeb5905166.zip | |
block: Fix AioContext switch for drained node
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 <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
| -rw-r--r-- | block.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) { |
