[libvirt] [PATCH 08/20] qemumonitortestutils: Don't crash on non fully initialized test
Eric Blake
eblake at redhat.com
Tue Jul 30 13:56:00 UTC 2013
On 07/30/2013 07:05 AM, Peter Krempa wrote:
> 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(-)
ACK.
>
> 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);
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130730/18ffffa3/attachment-0001.sig>
More information about the libvir-list
mailing list