From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:32903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTx6S-0001Rn-T7 for qemu-devel@nongnu.org; Fri, 25 Nov 2011 09:50:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTx6R-0006pd-MN for qemu-devel@nongnu.org; Fri, 25 Nov 2011 09:50:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTx6R-0006pX-9G for qemu-devel@nongnu.org; Fri, 25 Nov 2011 09:50:11 -0500 Message-ID: <4ECFAB0E.7020603@redhat.com> Date: Fri, 25 Nov 2011 15:49:50 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1314018774-27482-1-git-send-email-aliguori@us.ibm.com> <1314018774-27482-2-git-send-email-aliguori@us.ibm.com> <4E525C5A.8000208@redhat.com> <4E525D87.8010400@codemonkey.ws> <4E525E09.2000107@redhat.com> <4ECE7AA6.9070006@adacore.com> <4ECE7F38.4000704@redhat.com> <4ECF6CE7.3010800@adacore.com> <4ECF71FD.9090308@redhat.com> <4ECFAA34.6080309@adacore.com> In-Reply-To: <4ECFAA34.6080309@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] main: switch qemu_set_fd_handler to g_io_add_watch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: Blue Swirl , Anthony Liguori , qemu-devel@nongnu.org On 11/25/2011 03:46 PM, Fabien Chouteau wrote: >> > slirp is fd_set---thus select()---based. iohandler too, though it would likely be simpler to switch it to poll(). > Right, for slirp and iohandler, but it seems wrong to take file > descriptors from g_main_context_query() and put them in the fd_sets for > select(). This part is still in the code today. It's ugly, but it works. There's a fundamental impedence mismatch between glib and slirp/iohandler. Either you convert glib's pollfds to fd_sets, or you take slirp and iohandler's fd_sets and put them in pollfds. Converting slirp and iohandler to produce pollfds is not easy because Windows does not have poll---so you'd still have a pollfd-to-fd_set conversion somewhere. Believe me, I thought this through. :) Paolo