]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Set "qemu-event" thread identity
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 26 Oct 2021 09:06:07 +0000 (11:06 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 27 Oct 2021 15:11:39 +0000 (17:11 +0200)
commitefc1ccc75b396f38175ce99b900f86386f467da5
tree786db04ab9980fbec5def2c15b5bb56c741b1969
parent0c8f1aeddfa28e4ea194c80412a1c21af26e6ce3
qemu: Set "qemu-event" thread identity

It may happen that qemuProcessStop() is called from "qemu-event"
thread. But this thread doesn't have any virIdentity set
(virIdentity being thread local) and therefore it may be unable
to open connection to secondary drivers. It is unable to do so
in split daemon scenario, because in there opening a connection
is coupled with copying current thread identity onto the
connection. Code-wise, virIdentityGetCurrent() returns NULL which
in turn makes virGetConnectGeneric() fail. This problem does not
occur in monolithic daemon scenario, because no identity copying
is done there.

Long story short, inability to open secondary driver connection
can lead to unwanted results. Therefore, do what
qemuProcessReconnectHelper() does - set the new thread identity
to be the one of the caller.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2013573
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_driver.c