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 days ago
..
bdrv-next-monitor-owned.c
blk-commit-all.c include: Rename sysemu/ -> system/ 11 months ago
blk-exp-close-all.c meson: Drop the .fa library suffix 1 year ago
blockdev-close-all-bdrv-states.c
change-state-handler.c include: Rename sysemu/ -> system/ 11 months ago
cmos.c
cpu-destroy-address-spaces.c physmem: Destroy all CPU AddressSpaces on unrealize 1 month ago
cpu-get-clock.c include: Rename sysemu/ -> system/ 11 months ago
cpu-synchronize-state.c include: Rename sysemu/ -> system/ 11 months ago
cpus-virtual-clock.c include: Rename sysemu/ -> system/ 11 months ago
dump.c include: Rename sysemu/ -> system/ 11 months ago
error-printf.c
fdset.c monitor: Report errors from monitor_fdset_dup_fd_add 1 year ago
fw_cfg.c
gdbstub.c gdbstub: Introduce GDBFeature structure 2 years ago
get-vm-name.c include: Rename sysemu/ -> system/ 11 months ago
graph-lock.c
hotplug-stubs.c hw/core: Move system emulation files to system_ss 2 years ago
icount.c include/exec: Split out icount.h 7 months ago
igvm.c igvm: add support for initial register state load in native mode 2 weeks ago
iothread-lock-block.c
iothread-lock.c bql: Fix bql_locked status with condvar APIs 2 weeks ago
is-daemonized.c
linux-aio.c
meson.build block/io_uring: use aio_add_sqe() 3 days ago
migr-blocker.c migration: Use bitset of MigMode instead of variable arguments 2 weeks 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
qdev.c stubs: remove obsolete stubs 2 years ago
qemu-timer-notify-cb.c include: Rename sysemu/ -> system/ 11 months ago
qmp-command-available.c qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h 9 months ago
qmp-quit.c qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h 9 months ago
qtest.c include: Rename sysemu/ -> system/ 11 months ago
ram-block.c include/system: Move exec/memory.h to system/memory.h 7 months ago
replay-mode.c include: Rename sysemu/ -> system/ 11 months ago
replay-tools.c include: Rename sysemu/ -> system/ 11 months ago
replay.c stubs: split record/replay stubs further 2 years ago
runstate-check.c include: Rename sysemu/ -> system/ 11 months ago
sysbus.c
target-get-monitor-def.c
target-monitor-defs.c monitor: remove MonitorDef from typedefs.h 2 years ago
trace-control.c trace: remove code that depends on setting vcpu 2 years ago
uuid.c
vm-stop.c include: Rename sysemu/ -> system/ 11 months ago
vmstate.c migration: cpr-transfer mode 10 months ago
win32-kbd-hook.c
xen-hw-stub.c hw/xen: Remove unnecessary xen_hvm_inject_msi() stub 2 years ago