]> git.ipfire.org Git - thirdparty/qemu.git/commit
nbd/client-connection: nbd_co_establish_connection(): fix non set errp
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Mon, 6 Sep 2021 19:06:46 +0000 (22:06 +0300)
committerEric Blake <eblake@redhat.com>
Wed, 29 Sep 2021 18:46:33 +0000 (13:46 -0500)
commitf7ca4aadca865898ef9c52d75f142a9db622c712
tree1f1be2728e558d20fec6e9144645fb28510590ec
parentda24597dd37bc31b4d2328e5542fa3b5676a3fe0
nbd/client-connection: nbd_co_establish_connection(): fix non set errp

When we don't have a connection and blocking is false, we return NULL
but don't set errp. That's wrong.

We have two paths for calling nbd_co_establish_connection():

1. nbd_open() -> nbd_do_establish_connection() -> ...
  but that will never set blocking=false

2. nbd_reconnect_attempt() -> nbd_co_do_establish_connection() -> ...
  but that uses errp=NULL

So, we are safe with our wrong errp policy in
nbd_co_establish_connection(). Still let's fix it.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210906190654.183421-2-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
nbd/client-connection.c