Received: from eggs.gnu.org ([2001:4830:134:3::10]:48619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpeJR-0008Vr-N4 for qemu-devel@nongnu.org; Tue, 05 May 2015 10:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpeJN-0005cl-KP for qemu-devel@nongnu.org; Tue, 05 May 2015 10:59:09 -0400 Received: from mail-qc0-x22a.google.com ([2607:f8b0:400d:c01::22a]:35498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpeJN-0005ch-D1 for qemu-devel@nongnu.org; Tue, 05 May 2015 10:59:05 -0400 Received: by qcbgu10 with SMTP id gu10so48883123qcb.2 for ; Tue, 05 May 2015 07:59:04 -0700 (PDT) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 5 May 2015 16:58:55 +0200 Message-Id: <1430837936-24321-1-git-send-email-marcandre.lureau@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , kraxel@redhat.com When the virtio serial is writable, notify the chardev backend with qemu_chr_accept_input(). Signed-off-by: Marc-André Lureau --- 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