From 3367c21dadd04b457ec1979d09cef009fec10faf Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 14 Nov 2013 10:42:52 +0100 Subject: [PATCH] qemuProcessReconnectHelper: Don't create joinable thread 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 --- 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 e34f542e3f..f698d4764d 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);