mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
aio-posix: support userspace polling of fd monitoring
Unlike ppoll(2) and epoll(7), Linux io_uring completions can be polled from userspace. Previously userspace polling was only allowed when all AioHandler's had an ->io_poll() callback. This prevented starvation of fds by userspace pollable handlers. Add the FDMonOps->need_wait() callback that enables userspace polling even when some AioHandlers lack ->io_poll(). For example, it's now possible to do userspace polling when a TCP/IP socket is monitored thanks to Linux io_uring. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Link: https://lore.kernel.org/r/20200305170806.1313245-7-stefanha@redhat.com Message-Id: <20200305170806.1313245-7-stefanha@redhat.com>
This commit is contained in:
parent
73fd282e7b
commit
aa38e19f05
5 changed files with 35 additions and 3 deletions
|
|
@ -103,4 +103,5 @@ static void fdmon_poll_update(AioContext *ctx,
|
|||
const FDMonOps fdmon_poll_ops = {
|
||||
.update = fdmon_poll_update,
|
||||
.wait = fdmon_poll_wait,
|
||||
.need_wait = aio_poll_disabled,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue