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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]