[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] slirp: fill mainloop timeout with more prec
From: |
liu ping fan |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] slirp: fill mainloop timeout with more precise value |
Date: |
Tue, 13 Aug 2013 16:33:27 +0800 |
On Tue, Aug 13, 2013 at 4:29 PM, Jan Kiszka <address@hidden> wrote:
> On 2013-08-13 10:25, liu ping fan wrote:
>> On Tue, Aug 13, 2013 at 4:19 PM, Jan Kiszka <address@hidden> wrote:
>>> On 2013-08-13 05:15, Liu Ping Fan wrote:
>>>> If slirp needs to emulate tcp timeout, then the timeout value
>>>> for mainloop should be more precise, which is determined by
>>>> slirp's fasttimo or slowtimo.
>>>>
>>>> Signed-off-by: Liu Ping Fan <address@hidden>
>>>> ---
>>>> main-loop.c | 2 +-
>>>> slirp/slirp.c | 18 ++++++++++++++++++
>>>> 2 files changed, 19 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/main-loop.c b/main-loop.c
>>>> index a44fff6..04120d2 100644
>>>> --- a/main-loop.c
>>>> +++ b/main-loop.c
>>>> @@ -458,8 +458,8 @@ int main_loop_wait(int nonblocking)
>>>> g_array_set_size(gpollfds, 0); /* reset for new iteration */
>>>> /* XXX: separate device handlers from system ones */
>>>> #ifdef CONFIG_SLIRP
>>>> - slirp_update_timeout(&timeout);
>>>> slirp_pollfds_fill(gpollfds);
>>>> + slirp_update_timeout(&timeout);
>>>
>>> Why this reordering?
>>>
>> In order to give timeout more precise value, which is based on the
>> result of fasttimo or slowtimo after slirp_pollfds_fill()
>
> OK. But to avoid that the caller has to know this dependency, better
> merge the update timeout logic into pollfds_fill.
>
Fine. A good idea to the design.
Thx,
Pingfan