From patchwork Thu Apr 4 11:40:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 233748 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 4F0102C0092 for ; Thu, 4 Apr 2013 22:43:52 +1100 (EST) Received: from localhost ([::1]:35237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNia3-0004wS-MW for incoming@patchwork.ozlabs.org; Thu, 04 Apr 2013 07:43:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNiWw-0000Il-SB for qemu-devel@nongnu.org; Thu, 04 Apr 2013 07:40:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNiWt-0004qP-Lk for qemu-devel@nongnu.org; Thu, 04 Apr 2013 07:40:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNiWt-0004pz-Ey for qemu-devel@nongnu.org; Thu, 04 Apr 2013 07:40:31 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r34BeQ7p003662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Apr 2013 07:40:26 -0400 Received: from localhost (ovpn-112-26.ams2.redhat.com [10.36.112.26]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r34BePOK013822; Thu, 4 Apr 2013 07:40:26 -0400 From: Stefan Hajnoczi To: Date: Thu, 4 Apr 2013 13:40:14 +0200 Message-Id: <1365075615-14027-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1365075615-14027-1-git-send-email-stefanha@redhat.com> References: <1365075615-14027-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Michael Roth , Stefan Hajnoczi , Luiz Capitulino Subject: [Qemu-devel] [PATCH stable-1.4 3/4] qemu-socket: set passed fd non-blocking in socket_connect() 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 socket_connect() sets non-blocking on TCP or UNIX domain sockets if a callback function is passed. Do the same for file descriptor passing, otherwise we could unexpectedly be using a blocking file descriptor. Signed-off-by: Stefan Hajnoczi --- util/qemu-sockets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index e92e0d5..cd54fb4 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -906,6 +906,7 @@ int socket_connect(SocketAddress *addr, Error **errp, case SOCKET_ADDRESS_KIND_FD: fd = monitor_get_fd(cur_mon, addr->fd->str, errp); if (callback) { + qemu_set_nonblock(fd); callback(fd, opaque); } break;