qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>, kraxel@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable
Date: Tue,  5 May 2015 16:58:55 +0200	[thread overview]
Message-ID: <1430837936-24321-1-git-send-email-marcandre.lureau@gmail.com> (raw)

When the virtio serial is writable, notify the chardev backend
with qemu_chr_accept_input().

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
---
 hw/char/virtio-console.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 752ed2c..2a867cb 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -95,6 +95,15 @@ static void set_guest_connected(VirtIOSerialPort *port, int guest_connected)
     }
 }
 
+static void guest_writable(VirtIOSerialPort *port)
+{
+    VirtConsole *vcon = VIRTIO_CONSOLE(port);
+
+    if (vcon->chr) {
+        qemu_chr_accept_input(vcon->chr);
+    }
+}
+
 /* Readiness of the guest to accept data on a port */
 static int chr_can_read(void *opaque)
 {
@@ -188,6 +197,7 @@ static void virtserialport_class_init(ObjectClass *klass, void *data)
     k->unrealize = virtconsole_unrealize;
     k->have_data = flush_buf;
     k->set_guest_connected = set_guest_connected;
+    k->guest_writable = guest_writable;
     dc->props = virtserialport_properties;
 }
 
-- 
2.1.0

             reply	other threads:[~2015-05-05 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05 14:58 Marc-André Lureau [this message]
2015-05-05 14:58 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
2015-05-06  7:38 ` [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable Gerd Hoffmann
  -- strict thread matches above, loose matches on Subject: below --
2014-10-24  9:00 Marc-André Lureau

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=1430837936-24321-1-git-send-email-marcandre.lureau@gmail.com \
    --to=marcandre.lureau@gmail.com \
    --cc=kraxel@redhat.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).