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: <[email protected]>
Supersedes: <[email protected]>

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


Reply via email to