diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-10-05 12:02:21 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-10-05 12:02:21 +0100 |
commit | 5456c6a4ec9cd8fc314ddc303e88bf85c110975c (patch) | |
tree | 8e4786bfdf43921d8ff54aa6cf279769612d184d /util/aio-posix.c | |
parent | d147f7e815f97cb477e223586bcb80c316ae10ea (diff) | |
parent | f708a5e71cba0d784e307334c07ade5f56f827ab (diff) |
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Tue 03 Oct 2017 19:53:34 BST
# gpg: using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/block-pull-request:
aio: fix assert when remove poll during destroy
iothread: delay the context release to finalize
iothread: export iothread_stop()
iothread: provide helpers for internal use
qom: provide root container for internal objs
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/aio-posix.c')
-rw-r--r-- | util/aio-posix.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/util/aio-posix.c b/util/aio-posix.c index 2d51239ec6..5946ac09f0 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -223,7 +223,14 @@ void aio_set_fd_handler(AioContext *ctx, return; } - g_source_remove_poll(&ctx->source, &node->pfd); + /* If the GSource is in the process of being destroyed then + * g_source_remove_poll() causes an assertion failure. Skip + * removal in that case, because glib cleans up its state during + * destruction anyway. + */ + if (!g_source_is_destroyed(&ctx->source)) { + g_source_remove_poll(&ctx->source, &node->pfd); + } /* If the lock is held, just mark the node as deleted */ if (qemu_lockcnt_count(&ctx->list_lock)) { |