Received: from eggs.gnu.org ([2001:4830:134:3::10]:44322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC2yJ-0006vx-R1 for qemu-devel@nongnu.org; Wed, 21 Aug 2013 03:36:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VC2yI-0007Lu-MY for qemu-devel@nongnu.org; Wed, 21 Aug 2013 03:36:51 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:60821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC2yI-0007Ll-FQ for qemu-devel@nongnu.org; Wed, 21 Aug 2013 03:36:50 -0400 Date: Wed, 21 Aug 2013 08:36:36 +0100 From: Alex Bligh Message-ID: <15639A5F7F3F28E754294165@nimrod.local> In-Reply-To: <1377051352-23499-4-git-send-email-pingfank@linux.vnet.ibm.com> References: <1377051352-23499-1-git-send-email-pingfank@linux.vnet.ibm.com> <1377051352-23499-4-git-send-email-pingfank@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [Qemu-devel] [PATCH v3 3/3] slirp: set mainloop timeout with more precise value Reply-To: Alex Bligh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan , qemu-devel@nongnu.org Cc: Jan Kiszka , Alex Bligh , Stefan Hajnoczi , Paolo Bonzini --On 21 August 2013 10:15:52 +0800 Liu Ping Fan wrote: > -void slirp_update_timeout(uint32_t *timeout) > +static void slirp_update_timeout(uint32_t *timeout) > { > - if (!QTAILQ_EMPTY(&slirp_instances)) { > - *timeout = MIN(1000, *timeout); If you are putting things in macros, you might as well change that 1000 as well, and hopefully comment why that particular magic value is there. > + Slirp *slirp; > + uint32_t t; > + > + *timeout = MIN(1000, *timeout); > + if (*timeout <= TIMEOUT_FAST) { > + return; > + } > + t = *timeout; -- Alex Bligh