mirror of https://github.com/xqemu/xqemu.git
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:
parent
e02bc6de30
commit
af35e5e1fb
|
@ -251,6 +251,12 @@ static void test_event_d(TestEventData *data,
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
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);
|
qmp_event_set_func_emit(event_test_emit);
|
||||||
|
|
||||||
g_test_init(&argc, &argv, NULL);
|
g_test_init(&argc, &argv, NULL);
|
||||||
|
|
Loading…
Reference in New Issue