virtio-blk: add iothread-vq-mapping parameter
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 20 Dec 2023 13:47:55 +0000 (08:47 -0500)
committerKevin Wolf <kwolf@redhat.com>
Thu, 21 Dec 2023 21:49:28 +0000 (22:49 +0100)
commitb6948ab01df068bef591868c22d1f873d2d05cde
tree0f4409771270ba5ed28e53f284c117b8400b062d
parentcf03a152c5d749fd0083bfe540df9524f1d2ff1d
virtio-blk: add iothread-vq-mapping parameter

Add the iothread-vq-mapping parameter to assign virtqueues to IOThreads.
Store the vq:AioContext mapping in the new struct
VirtIOBlockDataPlane->vq_aio_context[] field and refactor the code to
use the per-vq AioContext instead of the BlockDriverState's AioContext.

Reimplement --device virtio-blk-pci,iothread= and non-IOThread mode by
assigning all virtqueues to the IOThread and main loop's AioContext in
vq_aio_context[], respectively.

The comment in struct VirtIOBlockDataPlane about EventNotifiers is
stale. Remove it.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20231220134755.814917-5-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/dataplane/virtio-blk.c
hw/block/dataplane/virtio-blk.h
hw/block/virtio-blk.c
include/hw/virtio/virtio-blk.h