From 1ab67b98cdd78b94ce818a7d0a964e3e4d7a4538 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Thu, 17 Jan 2019 15:43:55 +0400 Subject: slirp: replace global polling with per-instance & notifier Remove hard-coded dependency on slirp in main-loop, and use a "poll" notifier instead. The notifier is registered per slirp instance. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- include/qemu/main-loop.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/qemu/main-loop.h') diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h index e59f9ae1e9..f6ba78ea73 100644 --- a/include/qemu/main-loop.h +++ b/include/qemu/main-loop.h @@ -302,4 +302,19 @@ void qemu_fd_register(int fd); QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque); void qemu_bh_schedule_idle(QEMUBH *bh); +enum { + MAIN_LOOP_POLL_FILL, + MAIN_LOOP_POLL_ERR, + MAIN_LOOP_POLL_OK, +}; + +typedef struct MainLoopPoll { + int state; + uint32_t timeout; + GArray *pollfds; +} MainLoopPoll; + +void main_loop_poll_add_notifier(Notifier *notify); +void main_loop_poll_remove_notifier(Notifier *notify); + #endif -- cgit v1.2.3-55-g7522