qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH master/0.14] virtio-serial: Make sure virtqueue is ready before discarding data
@ 2011-02-04  8:54 Amit Shah
  2011-02-04 12:11 ` [Qemu-devel] " Juan Quintela
  2011-02-04 12:52 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 9+ messages in thread
From: Amit Shah @ 2011-02-04  8:54 UTC (permalink / raw)
  To: qemu list; +Cc: Amit Shah, Juan Quintela

This can happen if a port gets unplugged before guest has chance to
initialise vqs.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio-serial-bus.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 09e22aa..e05ab5e 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -117,6 +117,9 @@ static void discard_vq_data(VirtQueue *vq, VirtIODevice *vdev)
 {
     VirtQueueElement elem;
 
+    if (!virtio_queue_ready(vq)) {
+        return;
+    }
     while (virtqueue_pop(vq, &elem)) {
         virtqueue_push(vq, &elem, 0);
     }
-- 
1.7.3.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-02-08  7:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-04  8:54 [Qemu-devel] [PATCH master/0.14] virtio-serial: Make sure virtqueue is ready before discarding data Amit Shah
2011-02-04 12:11 ` [Qemu-devel] " Juan Quintela
2011-02-04 12:52 ` [Qemu-devel] " Anthony Liguori
2011-02-06  6:20   ` Amit Shah
2011-02-08  2:14     ` Amit Shah
2011-02-08  2:25       ` Anthony Liguori
2011-02-08  2:55         ` Amit Shah
2011-02-08  7:40           ` Anthony Liguori
2011-02-08  7:55             ` Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).