[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/2] aio-posix: Unregister fd from ctx epoll when rem
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 1/2] aio-posix: Unregister fd from ctx epoll when removing fd_handler. |
Date: |
Mon, 14 Jan 2019 16:34:15 +0000 |
From: Remy Noel <address@hidden>
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 <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
util/aio-posix.c | 3 +++
1 file changed, 3 insertions(+)
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);
--
2.20.1