On Mon, Sep 06, 2021 at 10:06:49PM +0300, Vladimir Sementsov-Ogievskiy wrote: > The only user of errp is call to nbd_do_establish_connection() in > nbd_open(). The only way to cancel this call is through open_timer
The only caller of nbd_do_establish_connection() that uses errp is nbd_open(). > timeout. And for this case, user will be more interested in description > of last failed connect rather than in > "Connection attempt cancelled by other operation". > > So, let's change behavior on cancel to return previous failure error if > available. > > Do the same for non-blocking failure case. In this case we still don't > have a caller that is interested in errp. But let's be consistent. > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> > --- > nbd/client-connection.c | 50 ++++++++++++++++++++++++++++------------- > 1 file changed, 34 insertions(+), 16 deletions(-) Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org