From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57562 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdO0i-00045W-VY for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:18:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdO0i-0004q4-1O for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:18:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdO0h-0004pO-PF for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:18:43 -0500 Date: Thu, 13 Jan 2011 19:48:31 +0530 From: Amit Shah Message-ID: <20110113141830.GF19434@amit-x200.redhat.com> References: <1bdf0a5a5de06cfb332ac17c439ef79cabb835db.1294923288.git.amit.shah@redhat.com> <4D2F044D.7020709@redhat.com> <20110113140057.GC19434@amit-x200.redhat.com> <4D2F0773.8060604@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D2F0773.8060604@redhat.com> Subject: [Qemu-devel] Re: [PATCH 3/5] iohandlers: Allow each iohandler to be enabled/disabled individually List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu list , Paul Brook On (Thu) Jan 13 2011 [15:08:51], Gerd Hoffmann wrote: > On 01/13/11 15:00, Amit Shah wrote: > >On (Thu) Jan 13 2011 [14:55:25], Gerd Hoffmann wrote: > >>On 01/13/11 14:00, Amit Shah wrote: > >>> { > >>>- return assign_fd_handlers(fd, fd_read_poll, fd_read, fd_write, opaque); > >>>+ assign_fd_handlers(fd, fd_read_poll, fd_read, fd_write, opaque); > >>>+ set_read_poll_fd_action(fd, true); > >>>+ set_read_fd_action(fd, true); > >>>+ set_write_fd_action(fd, true); > >>>+ return 0; > >>> } > >> > >>I'd suggest to move the *action calls into assign_fd_handlers() so > >>the handlers default to being enabled in all cases. This should > >>match what most users need and thus minimize the number of *_action > >>calls needed. > > > >What may happen with that is the fd may get select()-ed for an operation > >that it didn't want to be put on the queue for. > > I can't see such a race window given that most qemu code runs > serialized anyway. If you call assign_fd_handlers() + > set_write_fd_action(false) in sequence I can't see how a select call > can happen inbetween ... Not today, but later when we have threads doing this stuff? Should I just leave a comment to take care of this for later? Amit