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>
This commit is contained in:
Paolo Bonzini 2014-06-30 15:05:49 +02:00
parent e02bc6de30
commit af35e5e1fb

View File

@ -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);