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>,
	mdroth <mdroth@linux.vnet.ibm.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH v1 4/5] slirp: decouple timeout for gpoll
Date: Thu,  8 Aug 2013 14:26:10 +0800	[thread overview]
Message-ID: <1375943171-1063-5-git-send-email-pingfank@linux.vnet.ibm.com> (raw)
In-Reply-To: <1375943171-1063-1-git-send-email-pingfank@linux.vnet.ibm.com>

In order to decouple with main loop, we fill timeout for gpoll
through slirp's GSource prepare. (Later, after curtime is decoupled,
slirp system will be self-contained, and isolated from main-loop)

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

diff --git a/slirp/slirp.c b/slirp/slirp.c
index 37244be..ecc4d88 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -260,9 +260,6 @@ void slirp_cleanup(Slirp *slirp)
 
 void slirp_update_timeout(uint32_t *timeout)
 {
-    if (!QTAILQ_EMPTY(&slirp_instances)) {
-        *timeout = MIN(1000, *timeout);
-    }
     curtime = qemu_get_clock_ms(rt_clock);
 }
 
@@ -273,6 +270,7 @@ gboolean slirp_prepare(GSource *source, gint *time)
     struct socket *so, *so_next;
     int events = 0;
 
+    *time = MIN(1000, *time);
     /*
      * *_slowtimo needs calling if there are IP fragments
      * in the fragment queue, or there are TCP connections active
-- 
1.8.1.4

  parent reply	other threads:[~2013-08-08  6:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08  6:26 [Qemu-devel] [PATCH v1 0/5] make slirp subsystem self-contained Liu Ping Fan
2013-08-08  6:26 ` [Qemu-devel] [PATCH v1 1/5] util: introduce gsource event abstraction Liu Ping Fan
2013-08-08 16:29   ` Michael Roth
2013-08-09  7:10     ` liu ping fan
2013-08-08 21:03   ` Michael Roth
2013-08-08 21:12     ` Michael Roth
2013-08-14 19:26     ` Michael Roth
2013-08-08  6:26 ` [Qemu-devel] [PATCH v1 2/5] slirp: make timeout local Liu Ping Fan
2013-08-09  8:06   ` Paolo Bonzini
2013-08-09  8:48     ` liu ping fan
2013-08-09  9:32       ` Paolo Bonzini
2013-08-08  6:26 ` [Qemu-devel] [PATCH v1 3/5] slirp: make slirp event dispatch based on slirp instance Liu Ping Fan
2013-08-08  6:26 ` Liu Ping Fan [this message]
2013-08-08  6:26 ` [Qemu-devel] [PATCH v1 5/5] slirp: fold curtime into " 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=1375943171-1063-5-git-send-email-pingfank@linux.vnet.ibm.com \
    --to=qemulist@gmail.com \
    --cc=mdroth@linux.vnet.ibm.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).