[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] virtio: check for vring setup in virtio_queue_empty

From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH] virtio: check for vring setup in virtio_queue_empty
Date: Thu, 23 Feb 2017 09:51:30 +0100

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 <address@hidden>
Tested-by: Alex Williamson <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
 hw/virtio/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 
     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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]