From: Vladimir Sementsov-Ogievskiy Date: Mon, 6 Sep 2021 19:06:46 +0000 (+0300) Subject: nbd/client-connection: nbd_co_establish_connection(): fix non set errp X-Git-Tag: qemu-xen-4.17.0-rc4~310^2~5 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f7ca4aadca865898ef9c52d75f142a9db622c712;p=qemu-xen.git 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 Message-Id: <20210906190654.183421-2-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- diff --git a/nbd/client-connection.c b/nbd/client-connection.c index 7123b1e189..695f855754 100644 --- a/nbd/client-connection.c +++ b/nbd/client-connection.c @@ -318,6 +318,7 @@ nbd_co_establish_connection(NBDClientConnection *conn, NBDExportInfo *info, } if (!blocking) { + error_setg(errp, "No connection at the moment"); return NULL; }