]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-scsi: perform TMFs in appropriate AioContexts
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 11 Mar 2025 13:26:10 +0000 (21:26 +0800)
committerKevin Wolf <kwolf@redhat.com>
Thu, 13 Mar 2025 16:57:23 +0000 (17:57 +0100)
commitda6eebb33b08131d2dc7c2594f0998012fe69e2f
tree2ee6c8a5e3d18f9921b18077efe4c7ece4c824be
parent7d8ab5b2f77d84a21dbeb5b254e26320e1943af4
virtio-scsi: perform TMFs in appropriate AioContexts

With IOThread Virtqueue Mapping there will be multiple AioContexts
processing SCSI requests. scsi_req_cancel() and other SCSI request
operations must be performed from the AioContext where the request is
running.

Introduce a virtio_scsi_defer_tmf_to_aio_context() function and the
necessary VirtIOSCSIReq->remaining refcount infrastructure to move the
TMF code into the AioContext where the request is running.

For the time being there is still just one AioContext: the main loop or
the IOThread. When the iothread-vq-mapping parameter is added in a later
patch this will be changed to per-virtqueue AioContexts.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20250311132616.1049687-8-stefanha@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/scsi/virtio-scsi.c