From dd3dd4ba7b949662d2c67a4c041549b3d79c4b0e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 23 Feb 2017 09:51:30 +0100 Subject: virtio: check for vring setup in virtio_queue_empty If the vring has not been set up, there is nothing in the virtqueue. virtio_queue_host_notifier_aio_poll calls virtio_queue_empty even in this case; we have to filter it out just like virtio_queue_notify_aio_vq. Reported-by: Gerd Hoffmann Tested-by: Alex Williamson Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Laszlo Ersek Tested-by: Cornelia Huck --- hw/virtio/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 23483c7..e487e36 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2291,7 +2291,7 @@ static bool virtio_queue_host_notifier_aio_poll(void *opaque) VirtQueue *vq = container_of(n, VirtQueue, host_notifier); bool progress; - if (virtio_queue_empty(vq)) { + if (!vq->vring.desc || virtio_queue_empty(vq)) { return false; } -- cgit v1.1