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>
This commit is contained in:
Marc-André Lureau 2019-01-17 15:43:55 +04:00 committed by Samuel Thibault
parent 625a526b32
commit 1ab67b98cd
7 changed files with 374 additions and 350 deletions

View file

@ -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