From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqeWA-0000cp-K5 for qemu-devel@nongnu.org; Wed, 22 Mar 2017 07:33:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqeW5-0003QO-NW for qemu-devel@nongnu.org; Wed, 22 Mar 2017 07:33:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46098) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqeW5-0003Q0-HW for qemu-devel@nongnu.org; Wed, 22 Mar 2017 07:33:25 -0400 References: <1322109813.6444955.1490172025040.JavaMail.zimbra@redhat.com> From: Paolo Bonzini Message-ID: <5917da98-e569-47e8-016d-6cfb6e8c6958@redhat.com> Date: Wed, 22 Mar 2017 12:33:22 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Guest application reading from pl011 without device driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Jiahuan Zhang , QEMU Developers , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= On 22/03/2017 12:07, Peter Maydell wrote: > That's not the end that's a problem. Here we know we have > data available from the Windows end to read, we just > can't feed it to the QEMU UART model yet because the > UART model is saying "my FIFO is full, try later". > We should be able to handle that. (I couldn't figure > out how it works for the socket code either.) On every iteration of the glib main loop, tcp_chr_read_poll returns zero and io_watch_poll_prepare removes any previously created QIOChannel event source for the file descriptor When hw/char/pl011.c has free space in the FIFO tcp_chr_read_poll returns nonzero, io_watch_poll_prepare adds again the QIOChannel event source, the event source calls tcp_chr_read which reads from the socket and passes the data to the PL011. qemu_chr_fe_accept_input is only needed to force another call to tcp_chr_read_poll. Paolo