qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Liu Ping Fan <qemulist@gmail.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>
Subject: [Qemu-devel] [PATCH 2/3] slirp: define timeout as macro
Date: Tue, 13 Aug 2013 11:15:40 +0800	[thread overview]
Message-ID: <1376363741-19420-3-git-send-email-pingfank@linux.vnet.ibm.com> (raw)
In-Reply-To: <1376363741-19420-1-git-send-email-pingfank@linux.vnet.ibm.com>

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
 slirp/slirp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/slirp/slirp.c b/slirp/slirp.c
index 55654d5..1deaad9 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -47,6 +47,9 @@ static QTAILQ_HEAD(slirp_instances, Slirp) slirp_instances =
 static struct in_addr dns_addr;
 static u_int dns_addr_time;
 
+#define TIMEOUT_FAST 2
+#define TIMEOUT_SLOW 499
+
 #ifdef _WIN32
 
 int get_dns_addr(struct in_addr *pdns_addr)
@@ -452,11 +455,11 @@ void slirp_pollfds_poll(GArray *pollfds, int select_error)
         /*
          * See if anything has timed out
          */
-        if (slirp->time_fasttimo && ((curtime - slirp->time_fasttimo) >= 2)) {
+        if (slirp->time_fasttimo && ((curtime - slirp->time_fasttimo) >= TIMEOUT_FAST)) {
             tcp_fasttimo(slirp);
             slirp->time_fasttimo = 0;
         }
-        if (slirp->do_slowtimo && ((curtime - slirp->last_slowtimo) >= 499)) {
+        if (slirp->do_slowtimo && ((curtime - slirp->last_slowtimo) >= TIMEOUT_SLOW)) {
             ip_slowtimo(slirp);
             tcp_slowtimo(slirp);
             slirp->last_slowtimo = curtime;
-- 
1.8.1.4

  parent reply	other threads:[~2013-08-13  3:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  3:15 [Qemu-devel] [PATCH 0/3] slirp: fill mainloop with more precise timeout value Liu Ping Fan
2013-08-13  3:15 ` [Qemu-devel] [PATCH 1/3] slirp: make timeout local Liu Ping Fan
2013-08-13  8:03   ` Jan Kiszka
2013-08-13  8:30     ` liu ping fan
2013-08-13  3:15 ` Liu Ping Fan [this message]
2013-08-13  8:04   ` [Qemu-devel] [PATCH 2/3] slirp: define timeout as macro Jan Kiszka
2013-08-13  3:15 ` [Qemu-devel] [PATCH 3/3] slirp: fill mainloop timeout with more precise value Liu Ping Fan
2013-08-13  8:19   ` Jan Kiszka
2013-08-13  8:25     ` liu ping fan
2013-08-13  8:29       ` Jan Kiszka
2013-08-13  8:33         ` liu ping fan

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=1376363741-19420-3-git-send-email-pingfank@linux.vnet.ibm.com \
    --to=qemulist@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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).