Received: from eggs.gnu.org ([2001:4830:134:3::10]:42640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEjN6-0005rA-73 for qemu-devel@nongnu.org; Wed, 28 Aug 2013 13:17:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEjN0-0001df-7M for qemu-devel@nongnu.org; Wed, 28 Aug 2013 13:17:32 -0400 Received: from goliath.siemens.de ([192.35.17.28]:32213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEjMz-0001dS-UZ for qemu-devel@nongnu.org; Wed, 28 Aug 2013 13:17:26 -0400 Message-ID: <521E30A2.5040007@siemens.com> Date: Wed, 28 Aug 2013 19:17:22 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1377396081-12417-1-git-send-email-pingfank@linux.vnet.ibm.com> In-Reply-To: <1377396081-12417-1-git-send-email-pingfank@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 0/3] slirp: fill mainloop with more precise timeout value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan Cc: Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi 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 --- slirp/slirp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux