Re: [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable
On Di, 2015-05-05 at 16:58 +0200, Marc-André Lureau wrote: When the virtio serial is writable, notify the chardev backend with qemu_chr_accept_input(). added both patches to spice patch queue. thanks, Gerd
[Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable
When the virtio serial is writable, notify the chardev backend with qemu_chr_accept_input(). Signed-off-by: Marc-André Lureau marcandre.lur...@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
[Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable
When the virtio serial is writable, notify the chardev backend with qemu_chr_accept_input(). Signed-off-by: Marc-André Lureau marcandre.lur...@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