diff mbox

[v4,0/3] slirp: fill mainloop with more precise timeout value

Message ID 521E30A2.5040007@siemens.com
State New
Headers show

Commit Message

Jan Kiszka Aug. 28, 2013, 5:17 p.m. UTC
On 2013-08-25 04:01, Liu Ping Fan wrote:
> With this series, we can set the mainloop timeout more precisely when slirp has
> to emulate tcp timeout problem.
> 
> v4:
>   use macro TIMEOUT_DEFAULT to define the default timeout of slirp and document it.
> 
> v3:
>   fix comment: document timeout unit "milliseconds"
>   fix logic: no slirps, no timeout modifications in slirp_pollfds_fill()
> v2:
>   fold slirp_update_timeout logic into slirp_pollfds_fill.
> 
> 
> Liu Ping Fan (3):
>   slirp: make timeout local
>   slirp: define timeout as macro
>   slirp: set mainloop timeout with more precise value
> 
>  main-loop.c      |  3 +--
>  slirp/libslirp.h |  3 +--
>  slirp/slirp.c    | 61 +++++++++++++++++++++++++++++++++++++++-----------------
>  slirp/slirp.h    |  3 +++
>  stubs/slirp.c    |  6 +-----
>  5 files changed, 49 insertions(+), 27 deletions(-)
> 

Thanks, applied to the slirp queue. I'm carrying the tiny cleanup below
on top.

Jan

---

slirp: clean up slirp_update_timeout

No need to write out the timeout early, keep it local until we are done.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 slirp/slirp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/slirp/slirp.c b/slirp/slirp.c
index fe16367..bad8dad 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -270,8 +270,8 @@  static void slirp_update_timeout(uint32_t *timeout)
     if (*timeout <= TIMEOUT_FAST) {
         return;
     }
-    *timeout = MIN(1000, *timeout);
-    t = *timeout;
+
+    t = MIN(1000, *timeout);
 
     /* If we have tcp timeout with slirp, then we will fill @timeout with
      * more precise value.