summary refs log tree commit diff stats
path: root/include/qemu/main-loop.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-17 15:43:55 +0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-02-07 15:49:08 +0200
commit1ab67b98cdd78b94ce818a7d0a964e3e4d7a4538 (patch)
tree6170bef3ba22ffbe442ccd9e0336bbbbc0e49297 /include/qemu/main-loop.h
parent625a526b3298ce593983923b4d10fa582555f26d (diff)
downloadfocaccia-qemu-1ab67b98cdd78b94ce818a7d0a964e3e4d7a4538.tar.gz
focaccia-qemu-1ab67b98cdd78b94ce818a7d0a964e3e4d7a4538.zip
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 <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'include/qemu/main-loop.h')
-rw-r--r--include/qemu/main-loop.h15
1 files changed, 15 insertions, 0 deletions
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