summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorRemy Noel2018-12-20 16:20:29 +0100
committerStefan Hajnoczi2019-01-14 15:09:41 +0100
commit8821b34a7362d69b325c045dad4557782775683b (patch)
tree628379b8ce8555f07907862dbfb5a345eacf9b00 /util
parentMerge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2'... (diff)
downloadqemu-8821b34a7362d69b325c045dad4557782775683b.tar.gz
qemu-8821b34a7362d69b325c045dad4557782775683b.tar.xz
qemu-8821b34a7362d69b325c045dad4557782775683b.zip
aio-posix: Unregister fd from ctx epoll when removing fd_handler.
Cleaning the events will cause aio_epoll_update to unregister the fd. Otherwise, the fd is kept registered until it is destroyed. Signed-off-by: Remy Noel <remy.noel@blade-group.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20181220152030.28035-2-remy.noel@blade-group.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/aio-posix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/aio-posix.c b/util/aio-posix.c
index 51c41ed3c9..a927319d2c 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -245,6 +245,9 @@ void aio_set_fd_handler(AioContext *ctx,
QLIST_REMOVE(node, node);
deleted = true;
}
+ /* Clean events in order to unregister fd from the ctx epoll. */
+ node->pfd.events = 0;
+
poll_disable_change = -!node->io_poll;
} else {
poll_disable_change = !io_poll - (node && !node->io_poll);