qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] sane char device writes?


From: Michal Suchánek
Subject: Re: [Qemu-devel] sane char device writes?
Date: Mon, 28 Nov 2016 16:53:53 +0100

Hello,

On Fri, 25 Nov 2016 17:16:39 +0100
Paolo Bonzini <address@hidden> wrote:

> 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.
> 
Where will the characters come from, though? 

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.

Thanks

Michal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]