mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
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 <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
b403aaf04c
commit
791b4f9e0c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user