From d93d16c0450b3d0fe8e25568663531eb250d6aae Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Tue, 7 Dec 2021 13:23:32 +0000 Subject: 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 Reviewed-by: Stefano Garzarella Message-id: 20211207132336.36627-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'hw/virtio') diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 5db7f69..323f549 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -125,7 +125,7 @@ struct VirtQueue uint16_t vector; VirtIOHandleOutput handle_output; - VirtIOHandleAIOOutput handle_aio_output; + VirtIOHandleOutput handle_aio_output; VirtIODevice *vdev; EventNotifier guest_notifier; EventNotifier host_notifier; @@ -2303,22 +2303,18 @@ void virtio_queue_set_align(VirtIODevice *vdev, int n, int align) } } -static bool virtio_queue_notify_aio_vq(VirtQueue *vq) +static void virtio_queue_notify_aio_vq(VirtQueue *vq) { - bool ret = false; - if (vq->vring.desc && vq->handle_aio_output) { VirtIODevice *vdev = vq->vdev; trace_virtio_queue_notify(vdev, vq - vdev->vq, vq); - ret = vq->handle_aio_output(vdev, vq); + vq->handle_aio_output(vdev, vq); if (unlikely(vdev->start_on_kick)) { virtio_set_started(vdev, true); } } - - return ret; } static void virtio_queue_notify_vq(VirtQueue *vq) @@ -3555,7 +3551,7 @@ static void virtio_queue_host_notifier_aio_poll_end(EventNotifier *n) } void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx, - VirtIOHandleAIOOutput handle_output) + VirtIOHandleOutput handle_output) { if (handle_output) { vq->handle_aio_output = handle_output; -- cgit v1.1