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

[libvirt] [PATCH 08/20] 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 34ca1ae..5ca569f 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);
-- 
1.8.3.2


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