From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyFca-0006g4-H7 for qemu-devel@nongnu.org; Fri, 29 May 2015 04:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyFcW-0005nd-AH for qemu-devel@nongnu.org; Fri, 29 May 2015 04:26:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyFcW-0005nE-58 for qemu-devel@nongnu.org; Fri, 29 May 2015 04:26:24 -0400 From: Gerd Hoffmann Date: Fri, 29 May 2015 10:26:15 +0200 Message-Id: <1432887978-7411-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1432887978-7411-1-git-send-email-kraxel@redhat.com> References: <1432887978-7411-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 1/4] virtio-console: notify chardev when writable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amit Shah , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , "Michael S. Tsirkin" From: Marc-Andr=C3=A9 Lureau When the virtio serial is writable, notify the chardev backend with qemu_chr_accept_input(). Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Gerd Hoffmann --- 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) } } =20 +static void guest_writable(VirtIOSerialPort *port) +{ + VirtConsole *vcon =3D 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 *kl= ass, void *data) k->unrealize =3D virtconsole_unrealize; k->have_data =3D flush_buf; k->set_guest_connected =3D set_guest_connected; + k->guest_writable =3D guest_writable; dc->props =3D virtserialport_properties; } =20 --=20 1.8.3.1