qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 4/6 v2] virtio-serial: Call .guest_ready when new sp


From: Andrzej Zaborowski
Subject: [Qemu-devel] [PATCH 4/6 v2] virtio-serial: Call .guest_ready when new space is available in the queue.
Date: Thu, 23 Feb 2012 00:22:47 +0100

Without that it's impossible to write a virtio-serial port driver that
sends any buffers bigger than a couple kilobytes, other than by
polling to check when space in the queue becomes available.

Signed-off-by: Andrzej Zaborowski <address@hidden>
---
v2: rebase after QOM.
---
 hw/virtio-serial-bus.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index e22940e..fe350a1 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -498,6 +498,14 @@ static void handle_output(VirtIODevice *vdev, VirtQueue 
*vq)
 
 static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
 {
+    VirtIOSerial *vser = DO_UPCAST(VirtIOSerial, vdev, vdev);
+    VirtIOSerialPort *port = find_port_by_vq(vser, vq);
+    VirtIOSerialPortClass *info =
+        port ? VIRTIO_SERIAL_PORT_GET_CLASS(port) : NULL;
+
+    if (info && info->guest_ready) {
+        info->guest_ready(port);
+    }
 }
 
 static uint32_t get_features(VirtIODevice *vdev, uint32_t features)
-- 
1.7.4.4




reply via email to

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