Commit dd3dd4ba authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Michael S. Tsirkin
Browse files

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: default avatarGerd Hoffmann <kraxel@redhat.com>
Tested-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Tested-by: default avatarLaszlo Ersek <lersek@redhat.com>
Tested-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
parent 42697d88
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
    }