[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 3/3] slirp: set mainloop timeout with more pr
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH v3 3/3] slirp: set mainloop timeout with more precise value |
Date: |
Fri, 23 Aug 2013 18:49:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2013-08-21 10:07, liu ping fan wrote:
> On Wed, Aug 21, 2013 at 3:36 PM, Alex Bligh <address@hidden> wrote:
>>
>>
>> --On 21 August 2013 10:15:52 +0800 Liu Ping Fan <address@hidden> 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
>
> TIMEOUT_FAST/SLOW have definite meaning, and used more than one place
> in the code. For 1000ms, I do not know this magic value's meaning, but
> whatever, it just occurs once. So there is no trouble to read the
> code.
You could name it ONE_SEC or so. Can be done as trivial patch on top.
IIRC, slirp requires regular polling for the aging of certain requests
like DNS.
Jan
>
>> 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
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
Re: [Qemu-devel] [PATCH v3 0/3] slirp: fill mainloop with more precise timeout value, Stefan Hajnoczi, 2013/08/22