From patchwork Fri May 29 08:26:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 477627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2B528140E55 for ; Fri, 29 May 2015 18:29:07 +1000 (AEST) Received: from localhost ([::1]:34336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyFf7-000338-C6 for incoming@patchwork.ozlabs.org; Fri, 29 May 2015 04:29:05 -0400 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 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id A285A345AB5; Fri, 29 May 2015 08:26:23 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4T8QM3B027932; Fri, 29 May 2015 04:26:23 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 1BF5481949; Fri, 29 May 2015 10:26:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org 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 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Amit Shah , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , "Michael S. Tsirkin" Subject: [Qemu-devel] [PULL 1/4] virtio-console: notify chardev when writable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau When the virtio serial is writable, notify the chardev backend with qemu_chr_accept_input(). Signed-off-by: Marc-André 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) } } +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; }