Commit 8821b34a authored by Remy Noel's avatar Remy Noel Committed by Stefan Hajnoczi
Browse files

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: default avatarRemy Noel <remy.noel@blade-group.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Message-id: 20181220152030.28035-2-remy.noel@blade-group.com
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 7260438b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);