From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNpGs-0001Qp-7W for qemu-devel@nongnu.org; Mon, 25 Jan 2016 17:06:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNpGr-0004BC-42 for qemu-devel@nongnu.org; Mon, 25 Jan 2016 17:06:02 -0500 Date: Mon, 25 Jan 2016 22:05:50 +0000 From: "Daniel P. Berrange" Message-ID: <20160125220550.GA7337@redhat.com> References: <1453747275-9468-1-git-send-email-mreitz@redhat.com> <1453747275-9468-2-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1453747275-9468-2-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/8] nbd: client_close on error in nbd_co_client_start Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , Paolo Bonzini , Fam Zheng , qemu-devel@nongnu.org, qemu-block@nongnu.org On Mon, Jan 25, 2016 at 07:41:08PM +0100, Max Reitz wrote: > Use client_close() if an error in nbd_co_client_start() occurs instead > of manually inlining parts of it. This fixes an assertion error on the > server side if nbd_negotiate() fails. > > Signed-off-by: Max Reitz > --- > nbd/server.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/nbd/server.c b/nbd/server.c > index 2265cb0..5169b59 100644 > --- a/nbd/server.c > +++ b/nbd/server.c > @@ -1080,8 +1080,7 @@ static coroutine_fn void nbd_co_client_start(void *opaque) > nbd_export_get(exp); > } > if (nbd_negotiate(data)) { > - shutdown(client->sock, 2); > - client->close(client); > + client_close(client); > goto out; > } > qemu_co_mutex_init(&client->send_lock); The same as my fix last week :-) https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg03409.html Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|