|
From: | Gerd Hoffmann |
Subject: | [Qemu-devel] Re: [PATCH 3/5] iohandlers: Allow each iohandler to be enabled/disabled individually |
Date: | Thu, 13 Jan 2011 15:08:51 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Red Hat/3.1.7-3.el6_0 Thunderbird/3.1.7 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |