提交 dd3dd4ba 编写于 作者: P Paolo Bonzini 提交者: Michael S. Tsirkin

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: NGerd Hoffmann <kraxel@redhat.com>
Tested-by: NAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Tested-by: NLaszlo Ersek <lersek@redhat.com>
Tested-by: NCornelia Huck <cornelia.huck@de.ibm.com>
上级 42697d88
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册