From patchwork Tue May 14 11:48:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 243685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0CE2B2C00BF for ; Tue, 14 May 2013 21:49:23 +1000 (EST) Received: from localhost ([::1]:39365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcDjN-0008Uc-AX for incoming@patchwork.ozlabs.org; Tue, 14 May 2013 07:49:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcDj9-0008UU-8m for qemu-devel@nongnu.org; Tue, 14 May 2013 07:49:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcDj6-0001bV-UD for qemu-devel@nongnu.org; Tue, 14 May 2013 07:49:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcDj6-0001b1-ML for qemu-devel@nongnu.org; Tue, 14 May 2013 07:49:04 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4EBmxRn002641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 May 2013 07:48:59 -0400 Received: from yakj.usersys.redhat.com (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4EBmtnK007946; Tue, 14 May 2013 07:48:56 -0400 Message-ID: <519224A4.4000800@redhat.com> Date: Tue, 14 May 2013 13:48:52 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: TeLeMan References: <20130514000224.654.59977.malonedeb@wampee.canonical.com> <20130514075109.GB3632@stefanha-thinkpad.redhat.com> <519215F6.7090800@redhat.com> In-Reply-To: X-Enigmail-Version: 1.5.1 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Stefan Hajnoczi , qemu-devel , Fabien Chouteau , Bug 1179731 <1179731@bugs.launchpad.net> Subject: Re: [Qemu-devel] [Bug 1179731] [NEW] is networking broken on windows hosts? X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Il 14/05/2013 13:39, TeLeMan ha scritto: > On Tue, May 14, 2013 at 6:46 PM, Paolo Bonzini wrote: >> Il 14/05/2013 12:24, TeLeMan ha scritto: >>> On Tue, May 14, 2013 at 3:51 PM, Stefan Hajnoczi wrote: >>>> On Tue, May 14, 2013 at 12:02:24AM -0000, therock247uk wrote: >>>>> just wondering as i just compiled the latest git and qemu goes into none >>>>> responding mode when i try to do any networking stuff on guests (both >>>>> linux and windows) >>>> >>>> Works for me on qemu.git/master on Linux: >>>> >>>> $ git rev-parse HEAD >>>> b087143b4d010451208264b7c841436aafe1cbb1 >>>> $ x86_64-softmmu/qemu-system-x86_64 -m 1024 -enable-kvm -cpu host \ >>>> -drive if=virtio,cache=none,file=test.img >>>> >>>> Please include more information, like the QEMU command-line and commit >>>> ID. >>>> >>>> Stefan >>>> >>> >>> This regression occurs on the Windows host. SLIRP hangs in sorecvfrom(). >> >> Can you bisect it? >> >> Paolo >> > The first break is the commit > 5e3bc735d93dd23f074b5116fd11e1ad8cd4962f. But it need more packets > than HEAD to reproduce this regression. Please check if this partial revert of that commit fixes it: diff --git a/main-loop.c b/main-loop.c index f46aece..79c45b8 100644 --- a/main-loop.c +++ b/main-loop.c @@ -394,6 +394,20 @@ static int os_host_main_loop_wait(uint32_t timeout) return ret; } + FD_ZERO(&rfds); + FD_ZERO(&wfds); + FD_ZERO(&xfds); + nfds = pollfds_fill(gpollfds, &rfds, &wfds, &xfds); + if (nfds >= 0) { + select_ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv0); + if (select_ret != 0) { + timeout = 0; + } + if (select_ret > 0) { + pollfds_poll(gpollfds, nfds, &rfds, &wfds, &xfds); + } + } + g_main_context_prepare(context, &max_priority); n_poll_fds = g_main_context_query(context, max_priority, &poll_timeout, poll_fds, ARRAY_SIZE(poll_fds)); @@ -426,24 +440,11 @@ static int os_host_main_loop_wait(uint32_t timeout) g_main_context_dispatch(context); } - /* Call select after g_poll to avoid a useless iteration and therefore - * improve socket latency. + /* If an edge-triggered socket event occurred, select will return a + * positive result on the next iteration. We do not need to do anything + * here. */ - FD_ZERO(&rfds); - FD_ZERO(&wfds); - FD_ZERO(&xfds); - nfds = pollfds_fill(gpollfds, &rfds, &wfds, &xfds); - if (nfds >= 0) { - select_ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv0); - if (select_ret != 0) { - timeout = 0; - } - if (select_ret > 0) { - pollfds_poll(gpollfds, nfds, &rfds, &wfds, &xfds); - } - } - return select_ret || g_poll_ret; } #endif