mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
virtio: get rid of VirtIOHandleAIOOutput
The virtqueue host notifier API virtio_queue_aio_set_host_notifier_handler() polls the virtqueue for new buffers. AioContext previously required a bool progress return value indicating whether an event was handled or not. This is no longer necessary because the AioContext polling API has been split into a poll check function and an event handler function. The event handler is only run when we know there is work to do, so it doesn't return bool. The VirtIOHandleAIOOutput function signature is now the same as VirtIOHandleOutput. Get rid of the bool return value. Further simplifications will be made for virtio-blk and virtio-scsi in the next patch. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Message-id: 20211207132336.36627-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
826cc32423
commit
d93d16c045
4 changed files with 13 additions and 24 deletions
|
@ -49,49 +49,43 @@ void virtio_scsi_dataplane_setup(VirtIOSCSI *s, Error **errp)
|
|||
}
|
||||
}
|
||||
|
||||
static bool virtio_scsi_data_plane_handle_cmd(VirtIODevice *vdev,
|
||||
static void virtio_scsi_data_plane_handle_cmd(VirtIODevice *vdev,
|
||||
VirtQueue *vq)
|
||||
{
|
||||
bool progress = false;
|
||||
VirtIOSCSI *s = VIRTIO_SCSI(vdev);
|
||||
|
||||
virtio_scsi_acquire(s);
|
||||
if (!s->dataplane_fenced) {
|
||||
assert(s->ctx && s->dataplane_started);
|
||||
progress = virtio_scsi_handle_cmd_vq(s, vq);
|
||||
virtio_scsi_handle_cmd_vq(s, vq);
|
||||
}
|
||||
virtio_scsi_release(s);
|
||||
return progress;
|
||||
}
|
||||
|
||||
static bool virtio_scsi_data_plane_handle_ctrl(VirtIODevice *vdev,
|
||||
static void virtio_scsi_data_plane_handle_ctrl(VirtIODevice *vdev,
|
||||
VirtQueue *vq)
|
||||
{
|
||||
bool progress = false;
|
||||
VirtIOSCSI *s = VIRTIO_SCSI(vdev);
|
||||
|
||||
virtio_scsi_acquire(s);
|
||||
if (!s->dataplane_fenced) {
|
||||
assert(s->ctx && s->dataplane_started);
|
||||
progress = virtio_scsi_handle_ctrl_vq(s, vq);
|
||||
virtio_scsi_handle_ctrl_vq(s, vq);
|
||||
}
|
||||
virtio_scsi_release(s);
|
||||
return progress;
|
||||
}
|
||||
|
||||
static bool virtio_scsi_data_plane_handle_event(VirtIODevice *vdev,
|
||||
static void virtio_scsi_data_plane_handle_event(VirtIODevice *vdev,
|
||||
VirtQueue *vq)
|
||||
{
|
||||
bool progress = false;
|
||||
VirtIOSCSI *s = VIRTIO_SCSI(vdev);
|
||||
|
||||
virtio_scsi_acquire(s);
|
||||
if (!s->dataplane_fenced) {
|
||||
assert(s->ctx && s->dataplane_started);
|
||||
progress = virtio_scsi_handle_event_vq(s, vq);
|
||||
virtio_scsi_handle_event_vq(s, vq);
|
||||
}
|
||||
virtio_scsi_release(s);
|
||||
return progress;
|
||||
}
|
||||
|
||||
static int virtio_scsi_set_host_notifier(VirtIOSCSI *s, VirtQueue *vq, int n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue