]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Set identity for the reconnect all thread
authorJohn Ferlan <jferlan@redhat.com>
Mon, 12 Nov 2018 13:27:26 +0000 (08:27 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 14 Nov 2018 19:06:43 +0000 (14:06 -0500)
commitb04b82f8cb671f067bad2d5e922acf88f13f0934
treee9911e9ba67083af5b9f91653f2a7857ecc0d9cb
parent605496be609e153526fcdd3e98df8cf5244bc8fa
qemu: Set identity for the reconnect all thread

https://bugzilla.redhat.com/show_bug.cgi?id=1631622

If polkit authentication is enabled, an attempt to open
the connection failed during virAccessDriverPolkitGetCaller
when the call to virIdentityGetCurrent returned NULL resulting
in the errors:

  virAccessDriverPolkitGetCaller:87 : access denied:
  Policy kit denied action org.libvirt.api.connect.getattr from <anonymous>

Because qemuProcessReconnect runs in a thread during
daemonRunStateInit processing it doesn't have the thread
local identity. Thus when the virGetConnectNWFilter is
called as part of the qemuProcessFiltersInstantiate when
virDomainConfNWFilterInstantiate is run the attempt to get
the idenity fails and results in the anonymous error above.

To fix this, let's grab/use the virIdenityPtr of the process
that will be creating the thread, e.g. what daemonRunStateInit
has set and use that for our thread. That way any other similar
processing that uses/requires an identity for any other call
that would have previously been successfully run won't fail in
a similar manner.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_process.c