From: Michal Privoznik Date: Thu, 14 Nov 2013 09:42:52 +0000 (+0100) Subject: qemuProcessReconnectHelper: Don't create joinable thread X-Git-Tag: v1.2.0-rc1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3367c21dadd04b457ec1979d09cef009fec10faf;p=thirdparty%2Flibvirt.git 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 --- 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);