From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: KVM call minutes 2013-01-29 Date: Tue, 29 Jan 2013 17:01:57 +0100 Message-ID: <5107F275.407@redhat.com> References: <871ud4gfoa.fsf@elfo.elfo> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: KVM devel mailing list , qemu-devel qemu-devel , Alexander Graf , =?ISO-8859-1?Q?Andreas_F=E4rber?= To: quintela@redhat.com Return-path: Received: from mail-qa0-f43.google.com ([209.85.216.43]:35654 "EHLO mail-qa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070Ab3A2QCN (ORCPT ); Tue, 29 Jan 2013 11:02:13 -0500 Received: by mail-qa0-f43.google.com with SMTP id p6so1496420qad.9 for ; Tue, 29 Jan 2013 08:02:12 -0800 (PST) In-Reply-To: <871ud4gfoa.fsf@elfo.elfo> Sender: kvm-owner@vger.kernel.org List-ID: Il 29/01/2013 16:41, Juan Quintela ha scritto: > * Replacing select(2) so that we will not hit the 1024 fd_set limit in the > future. (stefan) > > Add checks for fd's bigger than 1024? multifunction devices uses lot > of fd's for device. > > Portability? > Use glib? and let it use poll underneath. > slirp is a problem. > in the end loop: moving to a glib event loop, how we arrive there is the discussion. We can use g_poll while keeping the main-loop.c wrappers around the glib event loop. Both slirp and iohandler.c access the fd_sets randomly, so we need to remember some state between the fill and poll functions. We can use two main-loop.c functions: int qemu_add_poll_fd(int fd, int events); select: writes the events into three fd_sets, returns the file descriptor itself poll: writes a GPollFD into a dynamically-sized array (of GPollFDs) and returns the index in the array. int qemu_get_poll_fd_revents(int index); select: takes the file descriptor (returned by qemu_add_poll_fd), makes up revents based on the three fd_sets poll: takes the index into the array and returns the corresponding revents iohandler.c can simply store the index into struct IOHandlerRecord, and use it later. slirp can do the same for struct socket. The select code can be kept for Windows after POSIX switches to poll. Paolo