From patchwork Thu Apr 4 14:18:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 233839 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 1EF702C009B for ; Fri, 5 Apr 2013 01:19:20 +1100 (EST) Received: from localhost ([::1]:47301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNl0Y-0000R9-2S for incoming@patchwork.ozlabs.org; Thu, 04 Apr 2013 10:19:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNl09-0000O5-5N for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:18:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNl02-0006G0-0L for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:18:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNl01-0006Fc-P2 for qemu-devel@nongnu.org; Thu, 04 Apr 2013 10:18:45 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r34EIgEP015675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Apr 2013 10:18:43 -0400 Received: from localhost (ovpn-112-26.ams2.redhat.com [10.36.112.26]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r34EIf8p014699; Thu, 4 Apr 2013 10:18:42 -0400 From: Stefan Hajnoczi To: Date: Thu, 4 Apr 2013 16:18:30 +0200 Message-Id: <1365085111-17027-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1365085111-17027-1-git-send-email-stefanha@redhat.com> References: <1365085111-17027-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Markus Armbruster , Michael Roth , Stefan Hajnoczi , Luiz Capitulino Subject: [Qemu-devel] [PATCH stable-1.4 v2 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 (cherry picked from commit 35fb94fa292173a3e1df0768433e06912a2a88e4) 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;