From af35e5e1fb8c334498c61cb9a568719483955a8f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 30 Jun 2014 15:05:49 +0200 Subject: [PATCH] tests/test-qmp-event: fix for GLib < 2.31 On old GLib, the test needs a g_thread_init call. Reported-by: Wenchao Xia Tested-by: Wenchao Xia Signed-off-by: Paolo Bonzini --- tests/test-qmp-event.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- GitLab