From patchwork Tue May 5 14:58:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 468136 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 C1910140771 for ; Wed, 6 May 2015 00:59:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=MREA+N3A; dkim-atps=neutral Received: from localhost ([::1]:39831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpeJu-0000aH-0I for incoming@patchwork.ozlabs.org; Tue, 05 May 2015 10:59:38 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=n6DgACKzV0OoFcSXopX55FDIoRv4lmvbxnEjl/t0l08=; b=MREA+N3ADk47AE6j1Zr50gyCbKyt7cqKbP0g11YEIzxjMcAC62HLLpi1onVGUfnsB/ p+VWhLDCzKiaqyreM2w6XaQ1x5iSKwko+rVtaws+A3mQuNZTZI8I4ffvs44wAAvdBt0K k15GrFDuE9AMmr7yh4z+hdPhvwL5LvsgyCbaGBJDd3zkBme72k4AOGCTUNHl8+RtznAC Bltz7+GoKOIZAZj0ElK1rMTWpZg4WGwxs+4VioVHsF9mZE+qGP5S+3km9lxOgT76Pn5+ QxP4KHgoeXwTFda4Bfy72cueJhVMdPcMdVEfCLst3FNbx+Hhb5sy5vWqPPkPCJ6sw1ZH uY7Q== X-Received: by 10.140.134.148 with SMTP id 142mr36219780qhg.100.1430837944079; Tue, 05 May 2015 07:59:04 -0700 (PDT) Received: from localhost (bne75-h02-31-39-163-232.dsl.sta.abo.bbox.fr. [31.39.163.232]) by mx.google.com with ESMTPSA id b141sm12228874qka.11.2015.05.05.07.59.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 May 2015 07:59:03 -0700 (PDT) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Tue, 5 May 2015 16:58:55 +0200 Message-Id: <1430837936-24321-1-git-send-email-marcandre.lureau@gmail.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c01::22a Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , kraxel@redhat.com Subject: [Qemu-devel] [PATCH 1/2] 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 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; }