From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzn1Y-0002mj-Kb for qemu-devel@nongnu.org; Wed, 25 Jun 2014 09:14:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzn1P-0002Uc-6I for qemu-devel@nongnu.org; Wed, 25 Jun 2014 09:14:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzn1O-0002UX-Sm for qemu-devel@nongnu.org; Wed, 25 Jun 2014 09:13:55 -0400 Date: Wed, 25 Jun 2014 09:13:51 -0400 From: Luiz Capitulino Message-ID: <20140625091351.7779916b@redhat.com> In-Reply-To: <1403652840-13449-2-git-send-email-wenchaoqemu@gmail.com> References: <1403652840-13449-1-git-send-email-wenchaoqemu@gmail.com> <1403652840-13449-2-git-send-email-wenchaoqemu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Wenchao Xia Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Tue, 24 Jun 2014 16:33:56 -0700 Wenchao Xia wrote: > From: Paolo Bonzini >=20 > On old GLib, the test needs a g_thread_init call. >=20 > 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(-) >=20 > 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, > =20 > int main(int argc, char **argv) > { > + g_thread_init(NULL); > qmp_event_set_func_emit(event_test_emit); > =20 > 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=3Ddeprecated-decla= rations] 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 instead. Also, note that thread_init()'s body is duplicated in a few other places, so maybe those places should call it too. You may want to do this in a different series, then I can skip this patch and apply the rest of the series.