qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH] Fix pasting into serial console in GTK ui


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH] Fix pasting into serial console in GTK ui
Date: Fri, 23 Dec 2016 17:29:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


On 23/12/2016 16:12, Michal Suchanek wrote:
> This copies the timer hack from ui/console.c kbd_send_chars to ui/gtk.c
> gd_vc_in.
> 
> There is no fd-like object to peek repatedly so the paste data is saved
> in a free-floating buffer only submitted to gtk_timeout_add. Multiple
> pastes can potentially interleave if qemu blocks for long or the user
> pastes fast.

Do not use a timer, instead set chr->chr_accept_input in gd_vc_handler.
The callback can do basically what you are doing in gd_vc_in_timer.  The
buffer can be just a GString plus a "head" pointer, in VirtualConsole.
Once the head catches up with the tail, you can free the GString.

Paolo



reply via email to

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