]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtio: check for vring setup in virtio_queue_empty
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Feb 2017 08:51:30 +0000 (09:51 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 2 Mar 2017 05:14:27 +0000 (07:14 +0200)
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>
hw/virtio/virtio.c

index 23483c752fa23668b7675b943e35f82733641703..e487e36cda0656e7f9b4d8238eb0ecb9aa7edbfe 100644 (file)
@@ -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;
     }