From: Peter Krempa Date: Thu, 8 Sep 2022 13:49:38 +0000 (+0200) Subject: remote: remoteOpenConn: Use virConnectOpenAuth instead of virConnectOpen(ReadOnly) X-Git-Tag: v8.8.0-rc1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=791b4f9e0c95746fece14db16e653fbc34ef1856;p=thirdparty%2Flibvirt.git remote: remoteOpenConn: Use virConnectOpenAuth instead of virConnectOpen(ReadOnly) virConnectOpenAuth provides an unified interface with using 'flags' to select the proper mode. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index 4f42cdc610..7efe58b36b 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1789,6 +1789,7 @@ remoteOpenConn(const char *uri, { g_autoptr(virTypedParamList) identparams = NULL; g_autoptr(virConnect) newconn = NULL; + unsigned int connectFlags = 0; VIR_DEBUG("Getting secondary uri=%s readonly=%d preserveIdent=%d conn=%p", NULLSTR(uri), readonly, preserveIdentity, conn); @@ -1813,11 +1814,9 @@ remoteOpenConn(const char *uri, VIR_DEBUG("Opening driver %s", uri); if (readonly) - newconn = virConnectOpenReadOnly(uri); - else - newconn = virConnectOpen(uri); + connectFlags |= VIR_CONNECT_RO; - if (!newconn) + if (!(newconn = virConnectOpenAuth(uri, NULL, connectFlags))) return -1; VIR_DEBUG("Opened driver %p", newconn);