On Wed, May 28, 2025 at 03:09:06PM -0400, Stefan Hajnoczi wrote:
> The io_uring(7) file descriptor monitor cannot enter polling mode
> because it needs to submit a POLL_ADD SQE every time a file descriptor
> becomes active. Submitting SQEs only happens in FDMonOps->wait() outside
> of polling mode.
> 
> Fix this using the multi-shot mechanism introduced in Linux 5.13 and
> liburing 2.1. Stable and enterprise Linux distros ship 5.14+ as of March
> 2025, so it is safe to require this. Note that fdmon-io_uring is
> currently not enabled at runtime and is not essential, so QEMU can still
> be built without it on older hosts.
> 
> In multi-shot mode, a POLL_ADD SQE remains active until canceled with
> POLL_REMOVE. This avoids the need to submit a new SQE every time a file
> descriptor becomes active.
> 
> When POLL_REMOVE is processed by the host kernel, the multi-shot
> POLL_ADD operation completes with -ECANCELED. Adjust the code slightly
> to take this into account.
> 
> Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
> ---

Reviewed-by: Eric Blake <ebl...@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org


Reply via email to