From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 2/3] libxl: fd events: Break out fd_occurs Date: Fri, 17 Apr 2015 16:21:24 -0400 Message-ID: <20150417202124.GA15386@l.oracle.com> References: <1429208608-6185-1-git-send-email-ian.jackson@eu.citrix.com> <1429208608-6185-3-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1429208608-6185-3-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Jim Fehlig , xen-devel@lists.xensource.com, Ian Campbell List-Id: xen-devel@lists.xenproject.org On Thu, Apr 16, 2015 at 07:23:27PM +0100, Ian Jackson wrote: > No functional change, only code motion. > > Currently, contrary to this function's name, there are two sites where > efd->func() is called so one of them doesn't go through here just yet. > That will be dealt with in the next commit. s/next commit/"libxl: fd events: Suppress spurious fd events"/ > > Signed-off-by: Ian Jackson > CC: Jim Fehlig > CC: Konrad Rzeszutek Wilk > --- > tools/libxl/libxl_event.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c > index 3efb357..2b2254e 100644 > --- a/tools/libxl/libxl_event.c > +++ b/tools/libxl/libxl_event.c > @@ -1121,6 +1121,14 @@ static int afterpoll_check_fd(libxl__poller *poller, > return revents; > } > > +static void fd_occurs(libxl__egc *egc, libxl__ev_fd *efd, short revents) > +{ > + DBG("ev_fd=%p occurs fd=%d events=%x revents=%x", > + efd, efd->fd, efd->events, revents); > + > + efd->func(egc, efd, efd->fd, efd->events, revents); > +} > + > static void afterpoll_internal(libxl__egc *egc, libxl__poller *poller, > int nfds, const struct pollfd *fds, > struct timeval now) > @@ -1183,10 +1191,7 @@ static void afterpoll_internal(libxl__egc *egc, libxl__poller *poller, > break; > > found_fd_event: > - DBG("ev_fd=%p occurs fd=%d events=%x revents=%x", > - efd, efd->fd, efd->events, revents); > - > - efd->func(egc, efd, efd->fd, efd->events, revents); > + fd_occurs(egc, efd, revents); > } > > if (afterpoll_check_fd(poller,fds,nfds, poller->wakeup_pipe[0],POLLIN)) { > -- > 1.7.10.4 >