Re: [Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new

2016-01-10 Thread Fam Zheng
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; > >

Re: [Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new

2016-01-08 Thread Paolo Bonzini
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

Re: [Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new

2016-01-08 Thread Daniel P. Berrange
On Wed, Dec 30, 2015 at 01:49:25PM +0800, Fam Zheng wrote: > In preparation for an async implementation, introduce a callback and > move the shutdown/close to the function. > > Signed-off-by: Fam Zheng > --- > blockdev-nbd.c | 5 ++--- > include/block/nbd.h | 6 -- > nbd.c

[Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new

2015-12-29 Thread Fam Zheng
In preparation for an async implementation, introduce a callback and move the shutdown/close to the function. Signed-off-by: Fam Zheng --- blockdev-nbd.c | 5 ++--- include/block/nbd.h | 6 -- nbd.c | 20 +++- qemu-nbd.c | 16 +--- 4