From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47839 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdNrN-0000IV-2q for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:09:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdNrL-0001mt-VS for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:09:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdNrL-0001mo-NW for qemu-devel@nongnu.org; Thu, 13 Jan 2011 09:09:03 -0500 Message-ID: <4D2F0773.8060604@redhat.com> Date: Thu, 13 Jan 2011 15:08:51 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <1bdf0a5a5de06cfb332ac17c439ef79cabb835db.1294923288.git.amit.shah@redhat.com> <4D2F044D.7020709@redhat.com> <20110113140057.GC19434@amit-x200.redhat.com> In-Reply-To: <20110113140057.GC19434@amit-x200.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Amit Shah Cc: qemu list , Paul Brook 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 ... cheers, Gerd