[PATCH 6/6] qemuProcessReconnectHelper: Don't create joinable thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the qemuProcessReconnectHelper() a new thread that do 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 make joinable.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index e34f542..f698d47 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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);
 
-- 
1.8.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]