Lines Matching refs:egc
248 short libxl__fd_poll_recheck(libxl__egc *egc, int fd, short events) { in libxl__fd_poll_recheck() argument
263 LIBXL__EVENT_DISASTER(egc, "failed poll to check for fd", errno, 0); in libxl__fd_poll_recheck()
346 static void time_aborted(libxl__egc *egc, libxl__ao_abortable *abrt, int rc) in time_aborted() argument
353 ev->func(egc, ev, &ev->abs, rc); in time_aborted()
446 static void time_occurs(libxl__egc *egc, libxl__ev_time *etime, int rc) in time_occurs() argument
454 func(egc, etime, &etime->abs, rc); in time_occurs()
503 static void watchfd_callback(libxl__egc *egc, libxl__ev_fd *ev, in watchfd_callback() argument
509 LIBXL__EVENT_DISASTER(egc, "unexpected poll event on watch fd", 0, 0); in watchfd_callback()
516 LIBXL__EVENT_DISASTER(egc, "cannot check/read watches", errno, 0); in watchfd_callback()
574 w->callback(egc, w, w->path, epath); in watchfd_callback()
699 static int evtchn_revents_check(libxl__egc *egc, int revents) in evtchn_revents_check() argument
705 LIBXL__EVENT_DISASTER(egc, in evtchn_revents_check()
716 static void evtchn_fd_callback(libxl__egc *egc, libxl__ev_fd *ev, in evtchn_fd_callback() argument
724 rc = evtchn_revents_check(egc, revents); in evtchn_fd_callback()
733 revents = libxl__fd_poll_recheck(egc,fd,POLLIN); in evtchn_fd_callback()
736 rc = evtchn_revents_check(egc, revents); in evtchn_fd_callback()
746 LIBXL__EVENT_DISASTER(egc, in evtchn_fd_callback()
763 evev->callback(egc, evev); in evtchn_fd_callback()
853 static void devstate_callback(libxl__egc *egc, libxl__xswait_state *xsw, in devstate_callback() argument
884 ds->callback(egc, ds, rc); in devstate_callback()
946 static void domaindeathcheck_callback(libxl__egc *egc, libxl__ev_xswatch *w, in domaindeathcheck_callback() argument
957 LIBXL__EVENT_DISASTER(egc,"failed to read xenstore" in domaindeathcheck_callback()
964 dc->callback(egc, dc, ERROR_DOMAIN_DESTROYED); in domaindeathcheck_callback()
967 static void domaindeathcheck_abort(libxl__egc *egc, in domaindeathcheck_abort() argument
975 dc->callback(egc, dc, rc); in domaindeathcheck_abort()
1192 static void fd_occurs(libxl__egc *egc, libxl__ev_fd *efd, short revents_ign) in fd_occurs() argument
1194 short revents_current = libxl__fd_poll_recheck(egc, efd->fd, efd->events); in fd_occurs()
1200 efd->func(egc, efd, efd->fd, efd->events, revents_current); in fd_occurs()
1203 static void afterpoll_internal(libxl__egc *egc, libxl__poller *poller, in afterpoll_internal() argument
1265 fd_occurs(egc, efd, revents); in afterpoll_internal()
1270 if (e) LIBXL__EVENT_DISASTER(egc, "read wakeup", e, 0); in afterpoll_internal()
1285 time_occurs(egc, etime, ERROR_TIMEDOUT); in afterpoll_internal()
1294 afterpoll_internal(egc, ctx->poller_app, nfds, fds, now); in libxl_osevent_afterpoll()
1329 fd_occurs(egc, ev, revents_ign); in libxl_osevent_occurred_fd()
1352 time_occurs(egc, ev, ERROR_TIMEDOUT); in libxl_osevent_occurred_timeout()
1359 void libxl__event_disaster(libxl__egc *egc, const char *msg, int errnoval, in libxl__event_disaster() argument
1384 static void egc_run_callbacks(libxl__egc *egc) in egc_run_callbacks() argument
1395 LIBXL_TAILQ_FOREACH_SAFE(ev, &egc->occurred_for_callback, link, ev_tmp) { in egc_run_callbacks()
1396 LIBXL_TAILQ_REMOVE(&egc->occurred_for_callback, ev, link); in egc_run_callbacks()
1402 LIBXL_TAILQ_FOREACH_SAFE(aop, &egc->aops_for_callback, entry, aop_tmp) { in egc_run_callbacks()
1403 LIBXL_TAILQ_REMOVE(&egc->aops_for_callback, aop, entry); in egc_run_callbacks()
1410 libxl__ao_complete_check_progress_reports(egc, aop->ao); in egc_run_callbacks()
1415 LIBXL_TAILQ_FOREACH_SAFE(ao, &egc->aos_for_callback, in egc_run_callbacks()
1417 LIBXL_TAILQ_REMOVE(&egc->aos_for_callback, ao, entry_for_callback); in egc_run_callbacks()
1427 void libxl__egc_cleanup(libxl__egc *egc) in libxl__egc_cleanup() argument
1430 egc_run_callbacks(egc); in libxl__egc_cleanup()
1446 void libxl__event_occurred(libxl__egc *egc, libxl_event *event) in libxl__event_occurred() argument
1456 LIBXL_TAILQ_INSERT_TAIL(&egc->occurred_for_callback, event, link); in libxl__event_occurred()
1462 libxl__poller_wakeup(egc, poller); in libxl__event_occurred()
1473 libxl_event *libxl__event_new(libxl__egc *egc, in libxl__event_new() argument
1491 static int event_check_internal(libxl__egc *egc, libxl_event **event_r, in event_check_internal() argument
1524 int rc = event_check_internal(egc, event_r, typemask, pred, pred_user); in libxl_event_check()
1654 void libxl__poller_wakeup(libxl__egc *egc, libxl__poller *p) in libxl__poller_wakeup() argument
1657 if (e) LIBXL__EVENT_DISASTER(egc, "cannot poke watch pipe", e, 0); in libxl__poller_wakeup()
1664 static int eventloop_iteration(libxl__egc *egc, libxl__poller *poller) { in eventloop_iteration() argument
1711 afterpoll_internal(egc, poller, nfds, poller->fd_polls, now); in eventloop_iteration()
1732 rc = event_check_internal(egc, event_r, typemask, pred, pred_user); in libxl_event_wait()
1735 rc = eventloop_iteration(egc, poller); in libxl_event_wait()
1744 libxl__egc_cleanup(egc); in libxl_event_wait()
1866 void libxl__ao_complete(libxl__egc *egc, libxl__ao *ao, int rc) in libxl__ao_complete() argument
1877 libxl__ao_complete_check_progress_reports(egc, ao); in libxl__ao_complete()
1893 void libxl__ao_complete_check_progress_reports(libxl__egc *egc, libxl__ao *ao) in libxl__ao_complete_check_progress_reports() argument
1896 libxl_ctx *ctx = libxl__gc_owner(&egc->gc); in libxl__ao_complete_check_progress_reports()
1906 libxl__poller_wakeup(egc, ao->poller); in libxl__ao_complete_check_progress_reports()
1909 LIBXL_TAILQ_INSERT_TAIL(&egc->aos_for_callback, ao, entry_for_callback); in libxl__ao_complete_check_progress_reports()
1912 ev = NEW_EVENT(egc, OPERATION_COMPLETE, ao->domid, ao->how.u.for_event); in libxl__ao_complete_check_progress_reports()
1915 libxl__event_occurred(egc, ev); in libxl__ao_complete_check_progress_reports()
1987 libxl__egc egc; in libxl__ao_inprogress() local
1988 LIBXL_INIT_EGC(egc,CTX); in libxl__ao_inprogress()
2001 rc = eventloop_iteration(&egc,ao->poller); in libxl__ao_inprogress()
2015 libxl__egc_cleanup(&egc); in libxl__ao_inprogress()
2054 libxl__egc egc; in ao__abort() local
2055 LIBXL_INIT_EGC(egc,ctx); in ao__abort()
2067 abrt->callback(&egc, abrt, ERROR_ABORTED); in ao__abort()
2070 libxl__egc_cleanup(&egc); in ao__abort()
2178 void libxl__ao_progress_report(libxl__egc *egc, libxl__ao *ao, in libxl__ao_progress_report() argument
2188 libxl__aop_occurred *aop = libxl__zalloc(&egc->gc, sizeof(*aop)); in libxl__ao_progress_report()
2193 LIBXL_TAILQ_INSERT_TAIL(&egc->aops_for_callback, aop, entry); in libxl__ao_progress_report()
2198 libxl__event_occurred(egc, ev); in libxl__ao_progress_report()