You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/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>
3 weeks ago
..
bdrv-next-monitor-owned.c Include qemu-common.h exactly where needed 7 years ago
blk-commit-all.c include: Rename sysemu/ -> system/ 12 months ago
blk-exp-close-all.c meson: Drop the .fa library suffix 1 year ago
blockdev-close-all-bdrv-states.c all: Clean up includes 10 years ago
change-state-handler.c include: Rename sysemu/ -> system/ 12 months ago
cmos.c stubs/cmos: Use correct include 5 years ago
cpu-destroy-address-spaces.c physmem: Destroy all CPU AddressSpaces on unrealize 2 months ago
cpu-get-clock.c include: Rename sysemu/ -> system/ 12 months ago
cpu-synchronize-state.c include: Rename sysemu/ -> system/ 12 months ago
cpus-virtual-clock.c include: Rename sysemu/ -> system/ 12 months ago
dump.c include: Rename sysemu/ -> system/ 12 months ago
error-printf.c Move error_printf_unless_qmp() with monitor unit 4 years ago
fdset.c monitor: Report errors from monitor_fdset_dup_fd_add 1 year ago
fw_cfg.c hw/nvram/fw_cfg: Add fw_cfg_arch_key_name() 7 years ago
gdbstub.c gdbstub: Introduce GDBFeature structure 2 years ago
get-vm-name.c include: Rename sysemu/ -> system/ 12 months ago
graph-lock.c async: Register/unregister aiocontext in graph lock list 3 years ago
hotplug-stubs.c hw/core: Move system emulation files to system_ss 2 years ago
icount.c include/exec: Split out icount.h 8 months ago
igvm.c igvm: add support for initial register state load in native mode 1 month ago
iothread-lock-block.c main-loop.h: introduce qemu_in_main_thread() 4 years ago
iothread-lock.c bql: Fix bql_locked status with condvar APIs 1 month ago
is-daemonized.c Include qemu-common.h exactly where needed 7 years ago
linux-aio.c linux-aio: properly bubble up errors from initialization 8 years ago
meson.build block/io_uring: use aio_add_sqe() 3 weeks ago
migr-blocker.c migration: Use bitset of MigMode instead of variable arguments 1 month ago
monitor-arm-gic.c qapi: expose query-gic-capability command unconditionally 6 months ago
monitor-core.c stubs: remove obsolete stubs 2 years ago
monitor-cpu-s390x-kvm.c qapi: make s390x specific CPU commands unconditionally available 6 months ago
monitor-cpu-s390x.c qapi: make most CPU commands unconditionally available 6 months ago
monitor-cpu.c qapi: make most CPU commands unconditionally available 6 months ago
monitor-i386-rtc.c qapi: expose rtc-reset-reinjection command unconditionally 6 months ago
monitor-i386-sev.c qapi: make SEV commands unconditionally available 6 months ago
monitor-i386-sgx.c qapi: make SGX commands unconditionally available 6 months ago
monitor-i386-xen.c qapi: make Xen event commands unconditionally available 6 months ago
monitor-internal.c stubs: move monitor_fdsets_cleanup with other fdset stubs 2 years ago
physmem.c stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd() 3 years ago
qdev.c stubs: remove obsolete stubs 2 years ago
qemu-timer-notify-cb.c include: Rename sysemu/ -> system/ 12 months ago
qmp-command-available.c qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h 10 months ago
qmp-quit.c qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h 10 months ago
qtest.c include: Rename sysemu/ -> system/ 12 months ago
ram-block.c include/system: Move exec/memory.h to system/memory.h 8 months ago
replay-mode.c include: Rename sysemu/ -> system/ 12 months ago
replay-tools.c include: Rename sysemu/ -> system/ 12 months ago
replay.c stubs: split record/replay stubs further 2 years ago
runstate-check.c include: Rename sysemu/ -> system/ 12 months ago
sysbus.c stubs: Clean up includes 10 years ago
target-get-monitor-def.c Clean up includes some more 10 years ago
target-monitor-defs.c monitor: remove MonitorDef from typedefs.h 2 years ago
trace-control.c trace: remove code that depends on setting vcpu 3 years ago
uuid.c qapi: Restrict query-uuid command to machine code 5 years ago
vm-stop.c include: Rename sysemu/ -> system/ 12 months ago
vmstate.c migration: cpr-transfer mode 10 months ago
win32-kbd-hook.c ui/win32-kbd-hook: handle AltGr in a hook procedure 6 years ago
xen-hw-stub.c hw/xen: Remove unnecessary xen_hvm_inject_msi() stub 2 years ago