From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAJBC-0005s9-4s for qemu-devel@nongnu.org; Fri, 25 Nov 2016 11:16:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAJB8-00045J-1C for qemu-devel@nongnu.org; Fri, 25 Nov 2016 11:16:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35826) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cAJB7-00044d-QF for qemu-devel@nongnu.org; Fri, 25 Nov 2016 11:16:45 -0500 References: <20161123190920.49f18f94@kitsune.suse.cz> From: Paolo Bonzini Message-ID: <1d449991-25f2-aedf-01c7-6fd976c02f14@redhat.com> Date: Fri, 25 Nov 2016 17:16:39 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] sane char device writes? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , =?UTF-8?Q?Michal_Such=c3=a1nek?= , qemu-devel@nongnu.org Cc: Gerd Hoffmann On 24/11/2016 08:51, Thomas Huth wrote: > > So for this to work an extra buffer would have to be stored in gtk.c > > somewhere, and possibly similar timer trick used as in console.c > > > > Any ideas how to do this without introducing too much insanity? > > > > Presumably using a GTK timer for repeating gd_vc_in the handler would > > run in the same GTK UI thread as the "commit" signal handler and > > excessive locking would not be required. > > > > The data passed to gd_vc_in is presumably freed when it ends so it > > would have to be copied somewhere. It's quite possible to create a > > static list in gd_vc_in or some extra field in VirtualConsole. > > Not sure how the best solution should really look like, but Paolo > suggested something here: > > http://lists.gnu.org/archive/html/qemu-devel/2016-11/msg02222.html > > ... so I'm putting him on CC: ... maybe he's got some spare minutes to > elaborate on his idea. My idea looks very much like Michal's. I hadn't gone very much beyond the "you need a buffer" step, but anyway you don't need a timer---you can just record a chr_accept_input callback in gd_vc_handler. It will be called when the front-end is ready to get more characters. Thanks, Paolo