mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
virGetConnectGeneric: Only delegate existing identities
Inside virt-qemu-run, just like in virsh for example, there is no identity set in the current thread, so we should not try to set it, otherwise things like connecting to other drivers might fail and on top of that there is no error set so the user can't even see what's wrong. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2000075 Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
15c11a7e54
commit
8e527dd653
12
src/driver.c
12
src/driver.c
@ -160,19 +160,17 @@ virGetConnectGeneric(virThreadLocal *threadPtr, const char *name)
|
||||
|
||||
if (conn->driver->connectSetIdentity != NULL) {
|
||||
g_autoptr(virIdentity) ident = NULL;
|
||||
g_autoptr(virTypedParamList) identparams = NULL;
|
||||
|
||||
VIR_DEBUG("Attempting to delegate current identity");
|
||||
if (!(ident = virIdentityGetCurrent()))
|
||||
goto error;
|
||||
ident = virIdentityGetCurrent();
|
||||
if (ident) {
|
||||
g_autoptr(virTypedParamList) tmp = virIdentityGetParameters(ident);
|
||||
|
||||
if (!(identparams = virIdentityGetParameters(ident)))
|
||||
goto error;
|
||||
|
||||
if (virConnectSetIdentity(conn, identparams->par, identparams->npar, 0) < 0)
|
||||
if (virConnectSetIdentity(conn, tmp->par, tmp->npar, 0) < 0)
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
return conn;
|
||||
|
||||
error:
|
||||
|
Loading…
Reference in New Issue
Block a user