From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vmpu8-0007Lg-DM for qemu-devel@nongnu.org; Sat, 30 Nov 2013 14:08:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vmptz-00050Z-W6 for qemu-devel@nongnu.org; Sat, 30 Nov 2013 14:08:36 -0500 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:37162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vmptz-0004yG-P5 for qemu-devel@nongnu.org; Sat, 30 Nov 2013 14:08:27 -0500 Received: by mail-ea0-f176.google.com with SMTP id h14so7540085eaj.7 for ; Sat, 30 Nov 2013 11:08:27 -0800 (PST) Sender: Paolo Bonzini Message-ID: <529A37A6.3020906@redhat.com> Date: Sat, 30 Nov 2013 20:08:22 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1385737124-13964-1-git-send-email-marcandre.lureau@gmail.com> <1385737124-13964-10-git-send-email-marcandre.lureau@gmail.com> <5298B152.10805@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 09/13] nbd: don't change socket block during negotiate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Marc-Andr=E9_Lureau?= Cc: =?ISO-8859-1?Q?Marc-Andr=E9_Lureau?= , qemu-devel@nongnu.org, Gerd Hoffmann Il 30/11/2013 16:49, Marc-André Lureau ha scritto: > So you suggest this block/unblock: (I haven't reviewed all callers of > unix_connect_opts(), I am not sure that's what you meant) Other option > would be to move the nonblock to unix_socket_outgoing. > > diff --git a/block/nbd-client.c b/block/nbd-client.c > index 1abfc6a..693110d 100644 > --- a/block/nbd-client.c > +++ b/block/nbd-client.c > @@ -348,6 +348,7 @@ int nbd_client_session_init(NbdClientSession *client, > int ret; > > /* NBD handshake */ > + qemu_set_block(sock); > ret = nbd_receive_negotiate(sock, client->export_name, > &client->nbdflags, &client->size, > &client->blocksize); Also qemu_set_nonblock(sock); here, and remove it from nbd_receive_negotiate. I checked again and you need not touch unix_connect_opts, nor nbd_client_thread. Paolo