qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrzej Zaborowski <andrew.zaborowski@intel.com>
To: qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <1329952970-356-4-git-send-email-andrew.zaborowski@intel.com> (raw)
In-Reply-To: <1329952970-356-1-git-send-email-andrew.zaborowski@intel.com>

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 <andrew.zaborowski@intel.com>
---
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

  parent reply	other threads:[~2012-02-23 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 23:22 [Qemu-devel] [PATCH 1/6 v2] gl: Add an OpenGL offscreen rendering API and backends Andrzej Zaborowski
2012-02-22 23:22 ` [Qemu-devel] [PATCH 2/6 v2] gl: Add mesa OpenGL headers Andrzej Zaborowski
2012-02-22 23:22 ` [Qemu-devel] [PATCH 3/6 v2] gl: OpenGL passthrough implementation Andrzej Zaborowski
2012-02-22 23:22 ` Andrzej Zaborowski [this message]
2012-02-22 23:22 ` [Qemu-devel] [PATCH 5/6 v2] gl: virtio-serial port driver for OpenGL passthrough Andrzej Zaborowski
2012-02-22 23:22 ` [Qemu-devel] [PATCH 6/6 v2] gl: -enable-gl switch to enable the OpenGL virtio port Andrzej Zaborowski

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=1329952970-356-4-git-send-email-andrew.zaborowski@intel.com \
    --to=andrew.zaborowski@intel.com \
    --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 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).