From a63a7a5af92e25662e623c51e44984cf4ab9deed Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 22 Jul 2013 16:57:08 +0200 Subject: [PATCH] qemumonitortestutils: Don't crash on non fully initialized test The qemumonitorjsontest crashed when one of the initialization steps done before starting the worker thread failed. This patch fixes this by trying to pthread_join() the thread only after it was created. --- tests/qemumonitortestutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 34ca1ae51b..5ca569fc2f 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -368,7 +368,8 @@ qemuMonitorTestFree(qemuMonitorTestPtr test) virObjectUnref(test->vm); - virThreadJoin(&test->thread); + if (test->running) + virThreadJoin(&test->thread); if (timer != -1) virEventRemoveTimeout(timer); -- GitLab