diff options
| author | Stefan Hajnoczi <stefanha@redhat.com> | 2025-03-11 21:26:15 +0800 |
|---|---|---|
| committer | Kevin Wolf <kwolf@redhat.com> | 2025-03-13 17:57:23 +0100 |
| commit | bcede51d2d1ae03f99ccb2569e52b5062033d40d (patch) | |
| tree | 81eb071797d86cf02fa9eb1914e46772df0bfb62 /hw/scsi/virtio-scsi-dataplane.c | |
| parent | 2e8e18c2e46307a355e547129b5a7a7000a0cf0d (diff) | |
| download | focaccia-qemu-bcede51d2d1ae03f99ccb2569e52b5062033d40d.tar.gz focaccia-qemu-bcede51d2d1ae03f99ccb2569e52b5062033d40d.zip | |
virtio-scsi: handle ctrl virtqueue in main loop
Previously the ctrl virtqueue was handled in the AioContext where SCSI requests are processed. When IOThread Virtqueue Mapping was added things become more complicated because SCSI requests could run in other AioContexts. Simplify by handling the ctrl virtqueue in the main loop where reset operations can be performed. Note that BHs are still used canceling SCSI requests in their AioContexts but at least the mean loop activity doesn't need BHs anymore. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20250311132616.1049687-13-stefanha@redhat.com> Tested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi/virtio-scsi-dataplane.c')
| -rw-r--r-- | hw/scsi/virtio-scsi-dataplane.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index 6bb368c8a5..2d37fa6712 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -73,6 +73,12 @@ void virtio_scsi_dataplane_setup(VirtIOSCSI *s, Error **errp) s->vq_aio_context[i] = ctx; } } + + /* + * Always handle the ctrl virtqueue in the main loop thread where device + * resets can be performed. + */ + s->vq_aio_context[0] = qemu_get_aio_context(); } /* Context: BQL held */ |