From: Avi Kivity <[EMAIL PROTECTED]>

Otherwise, we may miss incoming packets and only
collect them when some random timer fires.  Fixes
network throughput regression after qemu-cvs merge.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/qemu/vl.c b/qemu/vl.c
index 36a5928..28c5df4 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -7673,16 +7673,20 @@ void main_loop_wait(int timeout)
         slirp_select_fill(&nfds, &rfds, &wfds, &xfds);
     }
 #endif
+ moreio:
     ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv);
     if (ret > 0) {
         IOHandlerRecord **pioh;
+        int more = 0;
 
         for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) {
             if (!ioh->deleted && ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) {
                 ioh->fd_read(ioh->opaque);
+                more = 1;
             }
             if (!ioh->deleted && ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) {
                 ioh->fd_write(ioh->opaque);
+                more = 1;
             }
         }
 
@@ -7696,6 +7700,8 @@ void main_loop_wait(int timeout)
             } else
                 pioh = &ioh->next;
         }
+        if (more)
+            goto moreio;
     }
 #if defined(CONFIG_SLIRP)
     if (slirp_inited) {

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to