]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuProcessReconnectHelper: Don't create joinable thread
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Nov 2013 09:42:52 +0000 (10:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Nov 2013 16:44:20 +0000 (17:44 +0100)
In the qemuProcessReconnectHelper() a new thread that does all the
interesting work is spawned. The rationale is to not block the daemon
startup process in case of unresponsive qemu. However, the thread
handler is a local variable which gets lost once the control goes out of
scope. Hence the thread gets leaked. We can avoid this if the thread
isn't made joinable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c

index e34f542e3fa11bb5db498c67e8107eeb4329c635..f698d4764de078a4fa16b05eeceb26f9fe519322 100644 (file)
@@ -3281,7 +3281,7 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
      */
     virConnectRef(data->conn);
 
-    if (virThreadCreate(&thread, true, qemuProcessReconnect, data) < 0) {
+    if (virThreadCreate(&thread, false, qemuProcessReconnect, data) < 0) {
 
         virConnectClose(data->conn);