In order to decouple with main loop, we fill timeout for gpoll through slirp's GSource prepare. (Later, after curtime is decoupled, slirp system will be self-contained, and isolated from main-loop)
Signed-off-by: Liu Ping Fan <pingf...@linux.vnet.ibm.com> --- slirp/slirp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/slirp/slirp.c b/slirp/slirp.c index 37244be..ecc4d88 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -260,9 +260,6 @@ void slirp_cleanup(Slirp *slirp) void slirp_update_timeout(uint32_t *timeout) { - if (!QTAILQ_EMPTY(&slirp_instances)) { - *timeout = MIN(1000, *timeout); - } curtime = qemu_get_clock_ms(rt_clock); } @@ -273,6 +270,7 @@ gboolean slirp_prepare(GSource *source, gint *time) struct socket *so, *so_next; int events = 0; + *time = MIN(1000, *time); /* * *_slowtimo needs calling if there are IP fragments * in the fragment queue, or there are TCP connections active -- 1.8.1.4