diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-04-13 19:35:04 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-04-26 13:14:58 -0500 |
commit | 7c7db75576bd5a31508208f153c5aada64b2c8df (patch) | |
tree | c2e2d7bb3b8cdf92ea95fcea844452fb5aedf070 /slirp | |
parent | 4ffd16fc2900219c8ec8bb288b6fa3dfcae295a7 (diff) | |
download | qemu-7c7db75576bd5a31508208f153c5aada64b2c8df.zip qemu-7c7db75576bd5a31508208f153c5aada64b2c8df.tar.gz qemu-7c7db75576bd5a31508208f153c5aada64b2c8df.tar.bz2 |
main_loop_wait: block indefinitely
- remove qemu_calculate_timeout;
- explicitly size timeout to uint32_t;
- introduce slirp_update_timeout;
- pass NULL as timeout argument to select in case timeout is the maximum
value;
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Paul Brook <paul@codesourcery.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'slirp')
-rw-r--r-- | slirp/libslirp.h | 1 | ||||
-rw-r--r-- | slirp/slirp.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/slirp/libslirp.h b/slirp/libslirp.h index 890fd86..77527ad 100644 --- a/slirp/libslirp.h +++ b/slirp/libslirp.h @@ -15,6 +15,7 @@ Slirp *slirp_init(int restricted, struct in_addr vnetwork, struct in_addr vnameserver, void *opaque); void slirp_cleanup(Slirp *slirp); +void slirp_update_timeout(uint32_t *timeout); void slirp_select_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds); diff --git a/slirp/slirp.c b/slirp/slirp.c index 1502830..90473eb 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -258,6 +258,13 @@ void slirp_cleanup(Slirp *slirp) #define CONN_CANFRCV(so) (((so)->so_state & (SS_FCANTRCVMORE|SS_ISFCONNECTED)) == SS_ISFCONNECTED) #define UPD_NFDS(x) if (nfds < (x)) nfds = (x) +void slirp_update_timeout(uint32_t *timeout) +{ + if (!QTAILQ_EMPTY(&slirp_instances)) { + *timeout = MIN(1000, *timeout); + } +} + void slirp_select_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds) { |