2 * Event loop with file descriptor polling
4 * Copyright 2012 IBM, Corp.
5 * Copyright 2012 Red Hat, Inc. and/or its affiliates
8 * Stefan Hajnoczi <stefanha@redhat.com>
10 * This work is licensed under the terms of the GNU GPL, version 2 or later.
11 * See the COPYING file in the top-level directory.
18 #include "qemu/event_notifier.h"
20 typedef struct EventHandler EventHandler
;
21 typedef void EventCallback(EventHandler
*handler
);
23 EventNotifier
*notifier
; /* eventfd */
24 EventCallback
*callback
; /* callback function */
28 int epoll_fd
; /* epoll(2) file descriptor */
29 EventNotifier stop_notifier
; /* stop poll notifier */
30 EventHandler stop_handler
; /* stop poll handler */
33 void event_poll_add(EventPoll
*poll
, EventHandler
*handler
,
34 EventNotifier
*notifier
, EventCallback
*callback
);
35 void event_poll_init(EventPoll
*poll
);
36 void event_poll_cleanup(EventPoll
*poll
);
37 void event_poll(EventPoll
*poll
);
38 void event_poll_notify(EventPoll
*poll
);
40 #endif /* EVENT_POLL_H */