From patchwork Fri Mar 11 23:51:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Baumann X-Patchwork-Id: 8570501 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A4F2CC0553 for ; Fri, 11 Mar 2016 23:51:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C25392034C for ; Fri, 11 Mar 2016 23:51:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D46952034B for ; Fri, 11 Mar 2016 23:51:46 +0000 (UTC) Received: from localhost ([::1]:58299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeWqP-0000Fx-9M for patchwork-qemu-devel@patchwork.kernel.org; Fri, 11 Mar 2016 18:51:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeWqH-0000Fe-Jm for qemu-devel@nongnu.org; Fri, 11 Mar 2016 18:51:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeWqC-0002ZC-Oi for qemu-devel@nongnu.org; Fri, 11 Mar 2016 18:51:37 -0500 Received: from mail-bn1on0119.outbound.protection.outlook.com ([157.56.110.119]:12214 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeWqC-0002Xf-GW for qemu-devel@nongnu.org; Fri, 11 Mar 2016 18:51:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mNt0RNPy6Aicp0Bi9KjsGaE76G3H3tbLos2Rd1Eoy1I=; b=ab7rFQl4RxGK94C+dTtX2yjqzRe1U55OzL0NGre/GRLh1GG+y9u38md2JHO3srwNX9GcXeuSkZlTy+Ao4t9UKRLoSR8fU4ug0stxGGlaj8GEO6YCoNagIQwnZ0nnYBGtP5R/CM+z/e+KR+/jomwBVO8pvJ26E4ki7JntGKjyA88= Received: from BLUPR0301MB2034.namprd03.prod.outlook.com (10.164.22.24) by BLUPR0301MB2034.namprd03.prod.outlook.com (10.164.22.24) with Microsoft SMTP Server (TLS) id 15.1.427.16; Fri, 11 Mar 2016 23:51:29 +0000 Received: from BLUPR0301MB2034.namprd03.prod.outlook.com ([10.164.22.24]) by BLUPR0301MB2034.namprd03.prod.outlook.com ([10.164.22.24]) with mapi id 15.01.0427.020; Fri, 11 Mar 2016 23:51:29 +0000 From: Andrew Baumann To: Paolo Bonzini , "Daniel P. Berrange" , "qemu-devel@nongnu.org" Thread-Topic: [PATCH v2 00/18] Multiple fixes & improvements to QIOChannel & Win32 Thread-Index: AQHRevIYyDVtD/+dXEeNRN7fvuRQsp9S8PYAgAHxphA= Date: Fri, 11 Mar 2016 23:51:29 +0000 Message-ID: References: <1457630825-26638-1-git-send-email-berrange@redhat.com> <56E1B0B2.6080309@redhat.com> In-Reply-To: <56E1B0B2.6080309@redhat.com> Accept-Language: en-AU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2001:4898:80e8:6::6f3] x-ms-office365-filtering-correlation-id: 48e386f4-acef-40f8-28c4-08d34a08112a x-microsoft-exchange-diagnostics: 1; BLUPR0301MB2034; 5:SSklAqw5gTOExVowfRxMKtEYiOfjeKdJP8C3M8/G7uRiZrOVmesnr8p1ZgiUZN/X4CEiRjJBo0d7V1MGDuyOnkM8hq3RojQ6TapJ00B0bbzowF1XStSSgfcWj3RlxjmsJE1o0GHvj+Q9d5qPP34GVw==; 24:wW4M5OwjC4ApmdT4G35nmqBeFCpH5z2ju4FGr649mOI4EbVkKH4GXYEPawymnoWKrVeaG/fFusWohq4WVbCZQGum4fX1hJMgn6eqN9vPENI= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB2034; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(61426038)(61427038); SRVR:BLUPR0301MB2034; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0301MB2034; x-forefront-prvs: 087894CD3C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(377454003)(24454002)(479174004)(106116001)(74316001)(99286002)(54356999)(76576001)(76176999)(189998001)(2906002)(2501003)(15975445007)(3280700002)(1096002)(1220700001)(6116002)(102836003)(4326007)(3660700001)(5001770100001)(77096005)(586003)(92566002)(87936001)(5004730100002)(5008740100001)(2900100001)(2950100001)(19580405001)(10400500002)(81166005)(86362001)(10090500001)(33656002)(50986999)(5002640100001)(19580395003)(10290500002)(5005710100001)(122556002)(11100500001)(5003600100002)(3826002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR0301MB2034; H:BLUPR0301MB2034.namprd03.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2016 23:51:29.5689 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0301MB2034 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.56.110.119 Cc: Stefan Weil Subject: Re: [Qemu-devel] [PATCH v2 00/18] Multiple fixes & improvements to QIOChannel & Win32 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi folks, > From: Paolo Bonzini [mailto:pbonzini@redhat.com] > Sent: Thursday, 10 March 2016 9:37 AM > > On 10/03/2016 18:26, Daniel P. Berrange wrote: > > This series started out as an attempt to fix the Win32 problems > > identified by Andrew Baumann > > > > https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg01343.html > > > > It turned into a significantly larger cleanup of some chardev > > and osdep win32 portability code. [...] Sorry for chiming in a bit late here. I've tested these patches (the complete set, not individually), and they do appear to fix my immediate problem: socket char devices now work again. So thank you! However, I'm now seeing a problem I don't believe we had before: very slow responses to GDB commands. From looking at a packet capture (using a localhost tcp socket between qemu and my gdb client), it seems that a couple of operations will go through just fine, and then there is a 1 second delay between my client's request and qemu's response. After fiddling with poll timeouts, it became clear that we were noticing the socket events when waking up from the poll, but the events themselves were still not waking us. It turns out that we were not calling WSAEventSelect on the accept path. At least, the following patch fixed the problem for me: However, I'd note that both callers of tcp_chr_new_client() make the same call to set blocking to false immediately before calling tcp_chr_new_client(). Furthermore, the doc comment for qio_channel_set_blocking() appears to suggest that non-blocking mode is the default. If that's true, maybe you don't even want to rely on the caller explicitly setting blocking to false? Cheers, Andrew diff --git a/qemu-char.c b/qemu-char.c index 3bf30b5..c1be622 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3047,6 +3047,7 @@ static gboolean tcp_chr_accept(QIOChannel *channel, return TRUE; } + qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL); tcp_chr_new_client(chr, sioc); object_unref(OBJECT(sioc));