mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-21 21:25:25 +00:00
Use 'virTypedParamListFetch' for extracting identity parameters list
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
0fac024958
commit
50be70ded3
@ -165,8 +165,13 @@ virGetConnectGeneric(virThreadLocal *threadPtr, const char *name)
|
||||
ident = virIdentityGetCurrent();
|
||||
if (ident) {
|
||||
g_autoptr(virTypedParamList) tmp = virIdentityGetParameters(ident);
|
||||
virTypedParameterPtr par;
|
||||
size_t npar;
|
||||
|
||||
if (virConnectSetIdentity(conn, tmp->par, tmp->npar, 0) < 0)
|
||||
if (virTypedParamListFetch(tmp, &par, &npar) < 0)
|
||||
goto error;
|
||||
|
||||
if (virConnectSetIdentity(conn, par, npar, 0) < 0)
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
@ -1824,7 +1824,13 @@ remoteOpenConn(const char *uri,
|
||||
VIR_DEBUG("Opened driver %p", newconn);
|
||||
|
||||
if (preserveIdentity) {
|
||||
if (virConnectSetIdentity(newconn, identparams->par, identparams->npar, 0) < 0)
|
||||
virTypedParameterPtr par;
|
||||
size_t npar;
|
||||
|
||||
if (virTypedParamListFetch(identparams, &par, &npar) < 0)
|
||||
return -1;
|
||||
|
||||
if (virConnectSetIdentity(newconn, par, npar, 0) < 0)
|
||||
return -1;
|
||||
|
||||
VIR_DEBUG("Forwarded current identity to secondary driver");
|
||||
|
Loading…
Reference in New Issue
Block a user