From patchwork Thu May 16 09:32:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: TeLeMan X-Patchwork-Id: 244255 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 AC3D82C00A3 for ; Thu, 16 May 2013 19:32:35 +1000 (EST) Received: from localhost ([::1]:51870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcuY4-0001c2-98 for incoming@patchwork.ozlabs.org; Thu, 16 May 2013 05:32:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcuXi-0001al-FJ for qemu-devel@nongnu.org; Thu, 16 May 2013 05:32:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcuXe-000260-SH for qemu-devel@nongnu.org; Thu, 16 May 2013 05:32:10 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:36895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcuXe-00025j-HS for qemu-devel@nongnu.org; Thu, 16 May 2013 05:32:06 -0400 Received: by mail-wi0-f180.google.com with SMTP id hn14so2493336wib.1 for ; Thu, 16 May 2013 02:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=PJ3hGb0TCXsS7/ihVfDgSnHr9IDfTOUZ1oNYC+VC7BA=; b=e3ftPMDZfe6AlFnOMHf7InUCZLBxwRYvr5dBIM7629jIx9izWDvSUDgaZJu4ptPQZ5 2QTKPMvlssQPbe6RcHjmfhj8R+/dQZBaesGiK3kaRkjK//ErCLG0ihv+TNE8h9q7Vv4k eGIm/0CkdJKsWEwTu9BGK4YgUtjTKTd00TLAtHoR1OdcFgD5D80Jek8APyEz9bEGYoGb HO3JI/ziT0jU/ueQaU2azpgnEKI/npf37hKrVdNs06OXwqREJrIKJpwB8TRuzAqYh8h8 jhPkpyubRHAl23VFsXZtLfNCl6seqyoxAsKKxnovlkIlYyTlxDZjkIXKGI0Hl3Z85Wzj Uigg== MIME-Version: 1.0 X-Received: by 10.180.90.164 with SMTP id bx4mr22542516wib.13.1368696725739; Thu, 16 May 2013 02:32:05 -0700 (PDT) Received: by 10.217.117.132 with HTTP; Thu, 16 May 2013 02:32:05 -0700 (PDT) In-Reply-To: <51949FE1.1040209@redhat.com> References: <20130514000224.654.59977.malonedeb@wampee.canonical.com> <20130514075109.GB3632@stefanha-thinkpad.redhat.com> <519215F6.7090800@redhat.com> <519224A4.4000800@redhat.com> <5192261A.6030306@redhat.com> <5193493C.4010805@redhat.com> <51949FE1.1040209@redhat.com> Date: Thu, 16 May 2013 17:32:05 +0800 Message-ID: From: TeLeMan To: Paolo Bonzini X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::234 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 On Thu, May 16, 2013 at 4:59 PM, Paolo Bonzini wrote: > Il 16/05/2013 07:52, TeLeMan ha scritto: >> The patch is working on 134a03e0b3d34b01b68107104c525c3bff1211d4 and >> is not working from cbff4b342b000a7642125dbdabf61113e05eee44. > > Thanks. > > Fabien or Stefan, can you take a look? > > TeLeMan, can you post the exact patches that you tested on those two > commits? (To recap, there are at least two bugs. The first is fixed by > the patch at > http://article.gmane.org/gmane.comp.emulators.qemu/211333/raw, the > second is introduced by patch cbff4b3, main-loop: switch to g_poll() on > POSIX hosts, 2013-02-20). > > Paolo > The patch for cbff4b342b000a7642125dbdabf61113e05eee44: >> -- >> SUN OF A BEACH >> >> >> On Wed, May 15, 2013 at 4:37 PM, Paolo Bonzini wrote: >>> Il 15/05/2013 03:38, TeLeMan ha scritto: >>>> On Tue, May 14, 2013 at 7:55 PM, Paolo Bonzini wrote: >>>>> Il 14/05/2013 13:48, Paolo Bonzini ha scritto: >>>>>> 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: >>>>> >>>>> Yeah, this should work... WSAEventSelect is edge-triggered and the >>>>> event will not be signaled if the socket handler does not consume all >>>>> the data in the socket buffer. >>>> >>>> Unfortunately, it does not work. >>> >>> Ok... as you can see the patch is just moving a block of code just >>> before g_main_context_prepare(context, &max_priority). >>> >>> Can you please try doing the same on top of these six commits: >>> >>> 134a03e0b3d34b01b68107104c525c3bff1211d4 >>> cbff4b342b000a7642125dbdabf61113e05eee44 >>> 48ce11ff972c733afaed3e2a2613a2e56081ec92 >>> 8917c3bdba37d6fe4393db0fad3fabbde9530d6b >>> a3e4b4a8091cc4fcf7cb619570c72c54c2d6a6e9 >>> 9cbaacf999b01b27dc3a22502705178057af66de >>> >>> Paolo >> >> > diff --git a/main-loop.c b/main-loop.c index 489b27c..1558e4b 100644 --- a/main-loop.c +++ b/main-loop.c @@ -454,6 +454,22 @@ static int os_host_main_loop_wait(uint32_t timeout) return ret; } + gpollfds_from_select(); + 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); + } + } + gpollfds_to_select(select_ret); + 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)); @@ -493,21 +509,6 @@ static int os_host_main_loop_wait(uint32_t timeout) /* This back-and-forth between GPollFDs and select(2) is temporary. We'll * drop it in a couple of patches, I promise :). */ - gpollfds_from_select(); - 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); - } - } - gpollfds_to_select(select_ret); return select_ret || g_poll_ret; } The patch for 134a03e0b3d34b01b68107104c525c3bff1211d4 : diff --git a/main-loop.c b/main-loop.c index d0d8fe4..7cdd969 100644 --- a/main-loop.c +++ b/main-loop.c @@ -346,6 +346,13 @@ static int os_host_main_loop_wait(uint32_t timeout) return ret; } + if (nfds >= 0) { + select_ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv0); + if (select_ret != 0) { + timeout = 0; + } + } + 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)); @@ -382,12 +389,6 @@ static int os_host_main_loop_wait(uint32_t timeout) * improve socket latency. */ - if (nfds >= 0) { - select_ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv0); - if (select_ret != 0) { - timeout = 0; - } - } return select_ret || g_poll_ret; }