[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new |
Date: |
Mon, 11 Jan 2016 11:20:18 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, 01/08 19:24, Paolo Bonzini wrote:
>
>
> On 08/01/2016 17:24, Daniel P. Berrange wrote:
> >> > if (nbd_send_negotiate(client)) {
> >> > + shutdown(csock, 2);
> >> > + close(csock);
> >> > g_free(client);
> >> > - return NULL;
> >> > + ret = -1;
> >> > + goto out;
> > If you simply make this failure code branch call close_fn() then I
> > think you can adding needing the new NBDClientNewCB entirely if....
>
> Good idea, but note that close_fn will call nbd_client_put, so the
> close/g_free must be removed. It's probably cleanest to change csock to
> client->sock in the shutdown call, too.
Good suggestions, will update and resend. Thanks!
Fam