qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH master/0.14] virtio-serial: Make sure virtqueue


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH master/0.14] virtio-serial: Make sure virtqueue is ready before discarding data
Date: Fri, 04 Feb 2011 06:52:04 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10

On 02/04/2011 02:54 AM, Amit Shah wrote:
This can happen if a port gets unplugged before guest has chance to
initialise vqs.

Reported-by: Juan Quintela<address@hidden>
Signed-off-by: Amit Shah<address@hidden>

Applied to master, Thanks.

Regards,

Anthony Liguori
---
  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);
      }




reply via email to

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