qemu-cr16/stubs
Stefan Hajnoczi 047dabef97 block/io_uring: use aio_add_sqe()
AioContext has its own io_uring instance for file descriptor monitoring.
The disk I/O io_uring code was developed separately. Originally I
thought the characteristics of file descriptor monitoring and disk I/O
were too different, requiring separate io_uring instances.

Now it has become clear to me that it's feasible to share a single
io_uring instance for file descriptor monitoring and disk I/O. We're not
using io_uring's IOPOLL feature or anything else that would require a
separate instance.

Unify block/io_uring.c and util/fdmon-io_uring.c using the new
aio_add_sqe() API that allows user-defined io_uring sqe submission. Now
block/io_uring.c just needs to submit readv/writev/fsync and most of the
io_uring-specific logic is handled by fdmon-io_uring.c.

There are two immediate advantages:
1. Fewer system calls. There is no need to monitor the disk I/O io_uring
   ring fd from the file descriptor monitoring io_uring instance. Disk
   I/O completions are now picked up directly. Also, sqes are
   accumulated in the sq ring until the end of the event loop iteration
   and there are fewer io_uring_enter(2) syscalls.
2. Less code duplication.

Note that error_setg() messages are not supposed to end with
punctuation, so I removed a '.' for the non-io_uring build error
message.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20251104022933.618123-15-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2025-11-11 22:06:09 +01:00
..
bdrv-next-monitor-owned.c
blk-commit-all.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
blk-exp-close-all.c meson: Drop the .fa library suffix 2024-07-03 18:41:26 +02:00
blockdev-close-all-bdrv-states.c
change-state-handler.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cmos.c stubs/cmos: Use correct include 2020-09-01 09:10:58 +02:00
cpu-destroy-address-spaces.c physmem: Destroy all CPU AddressSpaces on unrealize 2025-10-03 09:48:02 -04:00
cpu-get-clock.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpu-synchronize-state.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpus-virtual-clock.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
dump.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
error-printf.c Move error_printf_unless_qmp() with monitor unit 2022-04-21 17:09:09 +04:00
fdset.c monitor: Report errors from monitor_fdset_dup_fd_add 2024-06-21 09:47:21 -03:00
fw_cfg.c
gdbstub.c gdbstub: Introduce GDBFeature structure 2023-10-11 08:46:33 +01:00
get-vm-name.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
graph-lock.c async: Register/unregister aiocontext in graph lock list 2022-12-15 16:07:43 +01:00
hotplug-stubs.c hw/core: Move system emulation files to system_ss 2024-04-18 11:17:27 +02:00
icount.c include/exec: Split out icount.h 2025-04-23 14:08:44 -07:00
igvm.c igvm: add support for initial register state load in native mode 2025-11-03 07:38:53 +01:00
iothread-lock-block.c main-loop.h: introduce qemu_in_main_thread() 2022-03-04 18:18:15 +01:00
iothread-lock.c bql: Fix bql_locked status with condvar APIs 2025-11-03 11:59:32 +01:00
is-daemonized.c
linux-aio.c
meson.build block/io_uring: use aio_add_sqe() 2025-11-11 22:06:09 +01:00
migr-blocker.c migration: Use bitset of MigMode instead of variable arguments 2025-11-03 16:04:10 -05:00
monitor-arm-gic.c qapi: expose query-gic-capability command unconditionally 2025-05-28 18:54:18 +02:00
monitor-core.c stubs: remove obsolete stubs 2024-04-18 11:17:27 +02:00
monitor-cpu-s390x-kvm.c qapi: make s390x specific CPU commands unconditionally available 2025-05-28 18:56:08 +02:00
monitor-cpu-s390x.c qapi: make most CPU commands unconditionally available 2025-05-28 18:55:50 +02:00
monitor-cpu.c qapi: make most CPU commands unconditionally available 2025-05-28 18:55:50 +02:00
monitor-i386-rtc.c qapi: expose rtc-reset-reinjection command unconditionally 2025-05-28 18:26:23 +02:00
monitor-i386-sev.c qapi: make SEV commands unconditionally available 2025-05-28 18:54:16 +02:00
monitor-i386-sgx.c qapi: make SGX commands unconditionally available 2025-05-28 18:54:18 +02:00
monitor-i386-xen.c qapi: make Xen event commands unconditionally available 2025-05-28 18:54:18 +02:00
monitor-internal.c stubs: move monitor_fdsets_cleanup with other fdset stubs 2024-04-18 11:17:27 +02:00
physmem.c stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd() 2022-10-26 14:56:42 -04:00
qdev.c stubs: remove obsolete stubs 2024-04-18 11:17:27 +02:00
qemu-timer-notify-cb.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
qmp-command-available.c qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h 2025-02-10 15:33:29 +01:00
qmp-quit.c qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h 2025-02-10 15:33:29 +01:00
qtest.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
ram-block.c include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
replay-mode.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
replay-tools.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
replay.c stubs: split record/replay stubs further 2024-04-18 11:17:27 +02:00
runstate-check.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
sysbus.c
target-get-monitor-def.c
target-monitor-defs.c monitor: remove MonitorDef from typedefs.h 2024-05-03 15:47:48 +02:00
trace-control.c trace: remove code that depends on setting vcpu 2023-06-01 11:05:05 -04:00
uuid.c qapi: Restrict query-uuid command to machine code 2020-09-29 15:41:35 +02:00
vm-stop.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
vmstate.c migration: cpr-transfer mode 2025-01-29 11:56:24 -03:00
win32-kbd-hook.c ui/win32-kbd-hook: handle AltGr in a hook procedure 2020-05-19 09:06:44 +02:00
xen-hw-stub.c hw/xen: Remove unnecessary xen_hvm_inject_msi() stub 2024-03-09 18:51:45 +01:00