Received: from eggs.gnu.org ([2001:4830:134:3::10]:48243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBOMd-0007fx-LA for qemu-devel@nongnu.org; Mon, 28 Nov 2016 11:01:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBOMZ-0003AT-T2 for qemu-devel@nongnu.org; Mon, 28 Nov 2016 11:01:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53070) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBOMZ-0003AD-NU for qemu-devel@nongnu.org; Mon, 28 Nov 2016 11:01:03 -0500 References: <20161123190920.49f18f94@kitsune.suse.cz> <1d449991-25f2-aedf-01c7-6fd976c02f14@redhat.com> <20161128165353.7f12d524@kitsune.suse.cz> From: Paolo Bonzini Message-ID: <894b4274-4e91-7fcf-5fb1-a82a98aef7ea@redhat.com> Date: Mon, 28 Nov 2016 17:00:58 +0100 MIME-Version: 1.0 In-Reply-To: <20161128165353.7f12d524@kitsune.suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] sane char device writes? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Michal_Such=c3=a1nek?= Cc: Thomas Huth , qemu-devel@nongnu.org, Gerd Hoffmann On 28/11/2016 16:53, Michal Such=E1nek wrote: >> >=20 >> > My idea looks very much like Michal's. I hadn't gone very much beyo= nd >> > the "you need a buffer" step, but anyway you don't need a timer---yo= u >> > can just record a chr_accept_input callback in gd_vc_handler. It wi= ll >> > be called when the front-end is ready to get more characters. >=20 > Where will the characters come from, though?=20 >From ui/gtk.c's own buffer. > This might solve the console ui hack since it has a pipe buffer it can > peek and read in pieces but the gtk ui gets a whole paste buffer in an > event callback and has to handle it whole before it returns from the > gtk event callback. Unless it stores the data that does not fit into > the serial fifo somewhere it has to drop it on the floor or block. Yes, gtk needs to have a buffer of its own (probably it should dynamically allocate it too, so that it can grow and shrink and the limit on the size can be higher). Paolo