qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable
@ 2014-10-24  9:00 Marc-André Lureau
  2014-10-24  9:00 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
  0 siblings, 1 reply; 11+ messages in thread
From: Marc-André Lureau @ 2014-10-24  9:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: amit.shah, Marc-André Lureau, kraxel

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>
---

Note:
This patch depends on Amit Shah patch:
"virtio: serial: expose a 'guest_writable' callback for users"

 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;
 }
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable
@ 2015-05-05 14:58 Marc-André Lureau
  2015-05-05 14:58 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
  0 siblings, 1 reply; 11+ messages in thread
From: Marc-André Lureau @ 2015-05-05 14:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, kraxel

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

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

end of thread, other threads:[~2015-05-05 14:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24  9:00 [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable Marc-André Lureau
2014-10-24  9:00 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
2014-10-27  8:08   ` Gerd Hoffmann
2014-10-27 11:45     ` Marc-André Lureau
2014-10-27 11:57       ` Gerd Hoffmann
2015-05-04  9:31         ` Amit Shah
2015-05-05  9:45           ` Gerd Hoffmann
2014-10-27 12:43   ` Amit Shah
2014-10-27 16:32     ` Marc-André Lureau
2014-10-28 14:51       ` Amit Shah
  -- strict thread matches above, loose matches on Subject: below --
2015-05-05 14:58 [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable Marc-André Lureau
2015-05-05 14:58 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau

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).