From: Remy Noel Date: Thu, 20 Dec 2018 15:20:29 +0000 (+0100) Subject: aio-posix: Unregister fd from ctx epoll when removing fd_handler. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8821b34a7362d69b325c045dad4557782775683b;p=qemu.git 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 Reviewed-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Message-id: 20181220152030.28035-2-remy.noel@blade-group.com Signed-off-by: Stefan Hajnoczi --- 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);