qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: liu ping fan <qemulist@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org, Alex Bligh <alex@alex.org.uk>
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	[thread overview]
Message-ID: <521792AB.7090909@siemens.com> (raw)
In-Reply-To: <CAJnKYQmR8wZVsAtEGah98aC=Gc7Sa5qwYpOrsK2-tdGQ4F-Byw@mail.gmail.com>

On 2013-08-21 10:07, liu ping fan wrote:
> On Wed, Aug 21, 2013 at 3:36 PM, Alex Bligh <alex@alex.org.uk> wrote:
>>
>>
>> --On 21 August 2013 10:15:52 +0800 Liu Ping Fan <qemulist@gmail.com> 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

  reply	other threads:[~2013-08-23 16:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21  2:15 [Qemu-devel] [PATCH v3 0/3] slirp: fill mainloop with more precise timeout value Liu Ping Fan
2013-08-21  2:15 ` [Qemu-devel] [PATCH v3 1/3] slirp: make timeout local Liu Ping Fan
2013-08-21  2:15 ` [Qemu-devel] [PATCH v3 2/3] slirp: define timeout as macro Liu Ping Fan
2013-08-21  2:15 ` [Qemu-devel] [PATCH v3 3/3] slirp: set mainloop timeout with more precise value Liu Ping Fan
2013-08-21  7:36   ` Alex Bligh
2013-08-21  8:07     ` liu ping fan
2013-08-23 16:49       ` Jan Kiszka [this message]
2013-08-25  1:52         ` liu ping fan
2013-08-23 16:54   ` Jan Kiszka
2013-08-25  1:53     ` liu ping fan
2013-08-22 12:07 ` [Qemu-devel] [PATCH v3 0/3] slirp: fill mainloop with more precise timeout value Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521792AB.7090909@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=alex@alex.org.uk \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemulist@gmail.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).