All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [Qemu-devel] [PULL 08/15] virtio: check for vring setup in virtio_queue_empty
Date: Thu, 2 Mar 2017 08:20:39 +0200	[thread overview]
Message-ID: <1488435591-17882-9-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1488435591-17882-1-git-send-email-mst@redhat.com>

From: Paolo Bonzini <pbonzini@redhat.com>

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 | 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 *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;
     }
 
-- 
MST

  parent reply	other threads:[~2017-03-02  6:20 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02  6:20 [Qemu-devel] [PULL 00/15] virtio, pc: fixes, features Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 01/15] linker-loader: Add new 'write pointer' command Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 02/15] docs: VM Generation ID device description Michael S. Tsirkin
2017-04-12 20:06   ` Marc-André Lureau
2017-04-12 20:17     ` Laszlo Ersek
2017-04-12 20:17     ` Ben Warren
2017-04-12 20:22       ` Marc-André Lureau
2017-04-12 20:25         ` Ben Warren
2017-04-12 20:47           ` Marc-André Lureau
2017-04-12 21:03             ` Ben Warren
2017-04-12 21:17               ` Marc-André Lureau
2017-04-12 21:25                 ` Michael S. Tsirkin
2017-04-13 10:18                 ` Marc-André Lureau
2017-04-12 20:20     ` Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 03/15] ACPI: Add vmgenid blob storage to the build tables Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 04/15] ACPI: Add Virtual Machine Generation ID support Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 05/15] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands Michael S. Tsirkin
2017-03-02  8:11   ` Markus Armbruster
2017-03-02  8:25     ` Laszlo Ersek
2017-03-02  8:37       ` Laszlo Ersek
2017-03-02  9:54         ` Markus Armbruster
2017-03-02  8:42       ` Markus Armbruster
2017-03-02 13:15         ` Laszlo Ersek
2017-03-02 14:50           ` Ben Warren
2017-03-02 15:32             ` Michael S. Tsirkin
2017-03-02 16:24               ` Laszlo Ersek
2017-03-02  6:20 ` [Qemu-devel] [PULL 06/15] tests: Move reusable ACPI code into a utility file Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 07/15] MAINTAINERS: Add VM Generation ID entries Michael S. Tsirkin
2017-03-02  6:20 ` Michael S. Tsirkin [this message]
2017-03-02  6:20 ` [Qemu-devel] [PULL 09/15] virtio: guard vring access when setting notification Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 10/15] virtio: invalidate memory in vring_set_avail_event() Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 11/15] virtio: add missing region cache init in virtio_load() Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 12/15] virtio: unbreak virtio-pci with IOMMU after caching ring translations Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 13/15] acpi: simplify _OSC Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 14/15] tests/acpi: update DSDT after last patch Michael S. Tsirkin
2017-03-02  6:20 ` [Qemu-devel] [PULL 15/15] hw/pxb-pcie: fix PCI Express hotplug support Michael S. Tsirkin
2017-03-02  8:34 ` [Qemu-devel] [PULL 00/15] virtio, pc: fixes, features Peter Maydell
2017-03-02 15:29   ` Michael S. Tsirkin
2017-03-03 12:42 ` Peter Maydell
2017-03-03 12:44 ` Peter Maydell
2017-03-03 19:10   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488435591-17882-9-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.