block-backend: process I/O in the current AioContext
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 12 Sep 2023 23:10:35 +0000 (19:10 -0400)
committerKevin Wolf <kwolf@redhat.com>
Wed, 20 Sep 2023 15:46:01 +0000 (17:46 +0200)
commit46eb6e861b0a622541593ea6db85e7c971dadb28
tree1f15f871266eae07a1d761d384a4d3c92c5e7e54
parentc8bf923d5eeed0b2bbe26feb37bb399ec1a894f5
block-backend: process I/O in the current AioContext

Switch blk_aio_*() APIs over to multi-queue by using
qemu_get_current_aio_context() instead of blk_get_aio_context(). This
change will allow devices to process I/O in multiple IOThreads in the
future.

I audited existing blk_aio_*() callers:
- migration/block.c: blk_mig_lock() protects the data accessed by the
  completion callback.
- The remaining emulated devices and exports run with
  qemu_get_aio_context() == blk_get_aio_context().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230912231037.826804-4-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/block-backend.c