qemu-devel
[Top][All Lists]
Advanced

[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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new
Date: Fri, 8 Jan 2016 19:24:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0


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.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]