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:
Peter Krempa 2023-04-18 15:47:42 +02:00
parent 0fac024958
commit 50be70ded3
2 changed files with 13 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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");