diff options
author | Paolo Bonzini | 2017-02-23 09:51:30 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2017-03-02 06:14:27 +0100 |
commit | dd3dd4ba7b949662d2c67a4c041549b3d79c4b0e (patch) | |
tree | 8d3a2ed7c07e11a224d84b21cd7003470f58248d /hw/virtio | |
parent | MAINTAINERS: Add VM Generation ID entries (diff) | |
download | qemu-dd3dd4ba7b949662d2c67a4c041549b3d79c4b0e.tar.gz qemu-dd3dd4ba7b949662d2c67a4c041549b3d79c4b0e.tar.xz qemu-dd3dd4ba7b949662d2c67a4c041549b3d79c4b0e.zip |
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 <kraxel@redhat.com>
Tested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/virtio')
-rw-r--r-- | hw/virtio/virtio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 23483c752f..e487e36cda 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; } |