diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-30 15:05:49 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-30 15:06:11 +0200 |
commit | af35e5e1fb8c334498c61cb9a568719483955a8f (patch) | |
tree | 47c0b7a895f1b2ad367349eb9995b829f1f51f6a /tests/test-qmp-event.c | |
parent | e02bc6de30c44fd668dc0d6e1cd1804f2eed3ed3 (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>
Diffstat (limited to 'tests/test-qmp-event.c')
-rw-r--r-- | tests/test-qmp-event.c | 6 |
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); |