[libvirt] [PATCH 08/20] qemumonitortestutils: Don't crash on non fully initialized test

Peter Krempa pkrempa at redhat.com
Tue Jul 30 13:05:43 UTC 2013


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




More information about the libvir-list mailing list