From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzn3G-0004py-Dj for qemu-devel@nongnu.org; Wed, 25 Jun 2014 09:15:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzn36-000362-T3 for qemu-devel@nongnu.org; Wed, 25 Jun 2014 09:15:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzn36-00035i-6t for qemu-devel@nongnu.org; Wed, 25 Jun 2014 09:15:40 -0400 Message-ID: <53AACB77.8000205@redhat.com> Date: Wed, 25 Jun 2014 15:15:35 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1403652840-13449-1-git-send-email-wenchaoqemu@gmail.com> <1403652840-13449-2-git-send-email-wenchaoqemu@gmail.com> <20140625091351.7779916b@redhat.com> In-Reply-To: <20140625091351.7779916b@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH FOR 2.1 1/5] tests/test-qmp-event: fix for GLib < 2.31 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino , Wenchao Xia Cc: qemu-devel@nongnu.org, armbru@redhat.com Il 25/06/2014 15:13, Luiz Capitulino ha scritto: > On Tue, 24 Jun 2014 16:33:56 -0700 > Wenchao Xia wrote: > >> From: Paolo Bonzini >> >> On old GLib, the test needs a g_thread_init call. >> >> Reported-by: Wenchao Xia >> Signed-off-by: Paolo Bonzini >> Tested-by: Wenchao Xia >> Signed-off-by: Wenchao Xia >> --- >> tests/test-qmp-event.c | 1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >> diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c >> index cb1e441..17c6444 100644 >> --- a/tests/test-qmp-event.c >> +++ b/tests/test-qmp-event.c >> @@ -251,6 +251,7 @@ static void test_event_d(TestEventData *data, >> >> int main(int argc, char **argv) >> { >> + g_thread_init(NULL); >> qmp_event_set_func_emit(event_test_emit); >> >> g_test_init(&argc, &argv, NULL); > > This breaks make check on F20: > > """ > /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c= : In function =E2=80=98main=E2=80=99: > /home/lcapitulino/work/src/upstream/qmp-unstable/tests/test-qmp-event.c= :254:5: error: =E2=80=98g_thread_init=E2=80=99 is deprecated (declared at= /usr/include/glib-2.0/glib/deprecated/gthread.h:260) [-Werror=3Ddeprecat= ed-declarations] > g_thread_init(NULL); > ^ > cc1: all warnings being treated as errors > make: *** [tests/test-qmp-event.o] Error 1 > """ > > I think the best way to fix this is to make util/osdep.c:thread_init() > public (maybe by moving it to include/glib-compat.h) and use that inste= ad. > Also, note that thread_init()'s body is duplicated in a few other place= s, > so maybe those places should call it too. > > You may want to do this in a different series, then I can skip this pat= ch > and apply the rest of the series. > Thanks Luiz, it's a good suggestion. Paolo