aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-06-30 15:05:49 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-06-30 15:06:11 +0200
commitaf35e5e1fb8c334498c61cb9a568719483955a8f (patch)
tree47c0b7a895f1b2ad367349eb9995b829f1f51f6a
parente02bc6de30c44fd668dc0d6e1cd1804f2eed3ed3 (diff)
tests/test-qmp-event: fix for GLib < 2.31
On old GLib, the test needs a g_thread_init call. Reported-by: Wenchao Xia <wenchaoqemu@gmail.com> Tested-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--tests/test-qmp-event.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
index cb1e4418ec..cb354e6e81 100644
--- a/tests/test-qmp-event.c
+++ b/tests/test-qmp-event.c
@@ -251,6 +251,12 @@ static void test_event_d(TestEventData *data,
int main(int argc, char **argv)
{
+#if !GLIB_CHECK_VERSION(2, 31, 0)
+ if (!g_thread_supported()) {
+ g_thread_init(NULL);
+ }
+#endif
+
qmp_event_set_func_emit(event_test_emit);
g_test_init(&argc, &argv, NULL);