qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v1 4/5] slirp: decouple timeout for gpoll


From: Liu Ping Fan
Subject: [Qemu-devel] [PATCH v1 4/5] slirp: decouple timeout for gpoll
Date: Thu, 8 Aug 2013 14:26:10 +0800

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]