From patchwork Thu Oct 21 16:18:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gianni Tedesco X-Patchwork-Id: 68726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 559031007D5 for ; Fri, 22 Oct 2010 03:20:30 +1100 (EST) Received: from localhost ([127.0.0.1]:37510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8xsR-0004Wc-8F for incoming@patchwork.ozlabs.org; Thu, 21 Oct 2010 12:20:27 -0400 Received: from [140.186.70.92] (port=48898 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8xqm-0003fD-QY for qemu-devel@nongnu.org; Thu, 21 Oct 2010 12:18:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8xql-0002vo-JV for qemu-devel@nongnu.org; Thu, 21 Oct 2010 12:18:44 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:18800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8xql-0002vU-GR for qemu-devel@nongnu.org; Thu, 21 Oct 2010 12:18:43 -0400 X-IronPort-AV: E=Sophos;i="4.58,218,1286164800"; d="scan'208";a="119091690" Received: from ftlpmailmx01.citrite.net ([10.9.154.223]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 21 Oct 2010 12:18:41 -0400 Received: from [10.80.2.76] (10.9.154.239) by FTLPMAILMX01.citrite.net (10.9.154.223) with Microsoft SMTP Server id 8.2.254.0; Thu, 21 Oct 2010 12:18:41 -0400 From: Gianni Tedesco To: "qemu-devel@nongnu.org" Date: Thu, 21 Oct 2010 17:18:39 +0100 Message-ID: <1287677919.12843.4383.camel@qabil.uk.xensource.com> MIME-Version: 1.0 X-Mailer: Evolution 2.28.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH]: VNC: set listener socket to non-blocking mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This prevents qemu from hanging waiting for a client to connect. I have reproduced this when doing a loadvm but it may be a more general problem in that poll/accept may race if a client aborts the connection with a RST before the accept has completed. In either case the fix seems harmless. Signed-off-by: Gianni Tedesco diff --git a/ui/vnc.c b/ui/vnc.c index 864342e..172b988 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2736,5 +2736,6 @@ int vnc_display_open(DisplayState *ds, const char *display) vs->display = dpy; } } + socket_set_nonblock(vs->lsock); return qemu_set_fd_handler2(vs->lsock, NULL, vnc_listen_read, NULL, vs); }