mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35: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();
|
ident = virIdentityGetCurrent();
|
||||||
if (ident) {
|
if (ident) {
|
||||||
g_autoptr(virTypedParamList) tmp = virIdentityGetParameters(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;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1824,7 +1824,13 @@ remoteOpenConn(const char *uri,
|
|||||||
VIR_DEBUG("Opened driver %p", newconn);
|
VIR_DEBUG("Opened driver %p", newconn);
|
||||||
|
|
||||||
if (preserveIdentity) {
|
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;
|
return -1;
|
||||||
|
|
||||||
VIR_DEBUG("Forwarded current identity to secondary driver");
|
VIR_DEBUG("Forwarded current identity to secondary driver");
|
||||||
|
Loading…
Reference in New Issue
Block a user