From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, kwolf@redhat.omc
Subject: [PATCH 0/5] block: move AioContext and AIOCB out of include/block/
Date: Wed, 3 Dec 2025 19:51:28 +0100 [thread overview]
Message-ID: <20251203185133.2458207-1-pbonzini@redhat.com> (raw)
Split include/block/aio.h into qemu/aiocb.h and qemu/aio.h,
and reduce the amount of included files from outside include/qemu/
for consistency with the implementation's placement in util/.
While Kevin originally suggested moving AIOCB declarations to
block-common.h, the functions are implemented in util/aiocb.c
and outside the block layer too, for example in the thread pool
(see thread_pool_submit_aio which is used in places such as 9pfs,
TPM backends or hw/virtio/virtio-pmem.c). So, do keep a separate
small header but call it util/aiocb.h---not block/aio.h.
Compared to the previous attempt, this introduces another teeny tiny
header qemu/mem-reentrancy.h, which is used to avoid including
hw/core/qdev.h
Also for consistency, move block/aio-wait.h to qemu/aio-wait.h;
it is effectively part of the main event loop implementation, not
the block layer.
Paolo
Based-on: <20251127131516.80807-1-pbonzini@redhat.com>
Supersedes: <20251128101555.227630-1-pbonzini@redhat.com>
Paolo Bonzini (5):
hw: add missing includes hidden by block/aio.h
block: extract include/qemu/aiocb.h out of include/block/aio.h
block: reduce files included by block/aio.h
block: rename block/aio.h to qemu/aio.h
block: rename block/aio-wait.h to qemu/aio-wait.h
MAINTAINERS | 4 ++--
docs/devel/multiple-iothreads.rst | 4 ++--
fsdev/qemu-fsdev-throttle.h | 1 -
include/block/block-copy.h | 1 +
include/block/block-global-state.h | 2 ++
include/block/block-io.h | 4 +++-
include/block/block_int-common.h | 2 +-
include/block/dirty-bitmap.h | 1 +
include/block/raw-aio.h | 3 ++-
include/block/thread-pool.h | 3 ++-
include/hw/char/serial.h | 1 +
include/hw/core/qdev.h | 6 +----
include/hw/ide/ide-dma.h | 2 +-
include/hw/scsi/scsi.h | 3 ++-
include/hw/virtio/virtio.h | 2 +-
include/io/channel.h | 2 +-
include/{block => qemu}/aio-wait.h | 2 +-
include/{block => qemu}/aio.h | 28 +++-------------------
include/qemu/aiocb.h | 38 ++++++++++++++++++++++++++++++
include/qemu/job.h | 4 +++-
include/qemu/main-loop.h | 4 ++--
include/qemu/mem-reentrancy.h | 10 ++++++++
include/qemu/throttle.h | 1 +
include/scsi/pr-manager.h | 2 +-
include/system/event-loop-base.h | 2 +-
include/system/iothread.h | 2 +-
include/system/replay.h | 2 +-
tests/unit/iothread.h | 2 +-
util/aio-posix.h | 2 +-
block/aio_task.c | 2 +-
block/export/fuse.c | 2 +-
block/io.c | 2 +-
block/io_uring.c | 2 +-
block/linux-aio.c | 2 +-
block/win32-aio.c | 3 ++-
blockjob.c | 2 +-
hw/core/ptimer.c | 1 -
hw/misc/i2c-echo.c | 1 -
hw/virtio/iothread-vq-mapping.c | 1 +
hw/virtio/virtio-pmem.c | 1 -
io/channel.c | 2 +-
iothread.c | 2 +-
job.c | 2 +-
net/colo-compare.c | 2 +-
net/filter-mirror.c | 2 +-
net/net.c | 1 +
qapi/qmp-dispatch.c | 2 +-
replay/replay-events.c | 2 +-
scsi/pr-manager.c | 2 +-
scsi/qemu-pr-helper.c | 1 -
stubs/linux-aio.c | 2 +-
stubs/replay-tools.c | 2 +-
tests/unit/iothread.c | 2 +-
tests/unit/test-aio-multithread.c | 2 +-
tests/unit/test-aio.c | 2 +-
tests/unit/test-nested-aio-poll.c | 2 +-
tests/unit/test-thread-pool.c | 3 ++-
tests/unit/test-throttle.c | 2 +-
ui/input-linux.c | 1 -
ui/vnc-jobs.c | 1 -
util/aio-wait.c | 2 +-
util/aiocb.c | 2 +-
util/async.c | 3 ++-
util/main-loop.c | 2 +-
util/qemu-co-timeout.c | 2 +-
util/qemu-coroutine-lock.c | 2 +-
util/qemu-coroutine-sleep.c | 2 +-
util/qemu-coroutine.c | 2 +-
util/throttle.c | 2 +-
util/vhost-user-server.c | 2 +-
hw/display/apple-gfx-mmio.m | 2 +-
hw/display/apple-gfx.m | 2 +-
scripts/analyze-inclusions | 2 +-
73 files changed, 128 insertions(+), 95 deletions(-)
rename include/{block => qemu}/aio-wait.h (99%)
rename include/{block => qemu}/aio.h (97%)
create mode 100644 include/qemu/aiocb.h
create mode 100644 include/qemu/mem-reentrancy.h
--
2.52.0
next reply other threads:[~2025-12-03 18:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-03 18:51 Paolo Bonzini [this message]
2025-12-03 18:51 ` [PATCH 1/5] hw: add missing includes hidden by block/aio.h Paolo Bonzini
2025-12-04 8:32 ` Philippe Mathieu-Daudé
2025-12-03 18:51 ` [PATCH 2/5] block: extract include/qemu/aiocb.h out of include/block/aio.h Paolo Bonzini
2025-12-04 8:33 ` Philippe Mathieu-Daudé
2025-12-03 18:51 ` [PATCH 3/5] block: reduce files included by block/aio.h Paolo Bonzini
2025-12-04 8:35 ` Philippe Mathieu-Daudé
2025-12-04 9:25 ` Paolo Bonzini
2025-12-04 17:03 ` Philippe Mathieu-Daudé
2025-12-04 17:46 ` Paolo Bonzini
2025-12-03 18:51 ` [PATCH 4/5] block: rename block/aio.h to qemu/aio.h Paolo Bonzini
2025-12-04 8:35 ` Philippe Mathieu-Daudé
2025-12-03 18:51 ` [PATCH 5/5] block: rename block/aio-wait.h to qemu/aio-wait.h Paolo Bonzini
2025-12-04 8:36 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251203185133.2458207-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=kwolf@redhat.omc \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).