]> git.proxmox.com Git - mirror_qemu.git/commit
virtio-scsi: fix ctrl and event handler functions in dataplane mode
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 27 Apr 2022 14:35:36 +0000 (15:35 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 9 May 2022 09:44:26 +0000 (10:44 +0100)
commit2f743ef6366c2df4ef51ef3ae318138cdc0125ab
tree693a523b962928f5321df22b29b865a7db4fedaf
parent71ad4713cc1d7fca24388b828ef31ae6cb38a31c
virtio-scsi: fix ctrl and event handler functions in dataplane mode

Commit f34e8d8b8d48d73f36a67b6d5e492ef9784b5012 ("virtio-scsi: prepare
virtio_scsi_handle_cmd for dataplane") prepared the virtio-scsi cmd
virtqueue handler function to be used in both the dataplane and
non-datpalane code paths.

It failed to convert the ctrl and event virtqueue handler functions,
which are not designed to be called from the dataplane code path but
will be since the ioeventfd is set up for those virtqueues when
dataplane starts.

Convert the ctrl and event virtqueue handler functions now so they
operate correctly when called from the dataplane code path. Avoid code
duplication by extracting this code into a helper function.

Fixes: f34e8d8b8d48d73f36a67b6d5e492ef9784b5012 ("virtio-scsi: prepare virtio_scsi_handle_cmd for dataplane")
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20220427143541.119567-2-stefanha@redhat.com
[Fixed s/by used/be used/ typo pointed out by Michael Tokarev
<mjt@tls.msk.ru>.
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/scsi/virtio-scsi.c