]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: fd events: Break out fd_occurs
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 16 Apr 2015 18:23:27 +0000 (19:23 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 22 Apr 2015 13:53:47 +0000 (14:53 +0100)
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.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Jim Fehlig <jfehlig@suse.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_event.c

index 3efb357472bc7306390fc79533b99726573cd437..2b2254eff60c1f59b5c1bec23490bff38cc90940 100644 (file)
@@ -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)) {