From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3ODM-0004tq-G5 for qemu-devel@nongnu.org; Mon, 30 Nov 2015 08:10:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3ODI-0004CR-3s for qemu-devel@nongnu.org; Mon, 30 Nov 2015 08:09:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3ODH-0004CB-VM for qemu-devel@nongnu.org; Mon, 30 Nov 2015 08:09:52 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 9294F257 for ; Mon, 30 Nov 2015 13:09:51 +0000 (UTC) Date: Mon, 30 Nov 2015 15:09:49 +0200 From: "Michael S. Tsirkin" Message-ID: <20151130150822-mutt-send-email-mst@redhat.com> References: <1448635280-941-1-git-send-email-marcandre.lureau@redhat.com> <1448635280-941-4-git-send-email-marcandre.lureau@redhat.com> <20151130125657-mutt-send-email-mst@redhat.com> <2065023007.20674130.1448881229487.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <2065023007.20674130.1448881229487.JavaMail.zimbra@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-2.5 3/3] vhost-user-test: fix crash with glib < 2.36 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau Cc: marcandre lureau , qemu-devel@nongnu.org On Mon, Nov 30, 2015 at 06:00:29AM -0500, Marc-Andr=E9 Lureau wrote: >=20 >=20 > ----- Original Message ----- > > On Fri, Nov 27, 2015 at 03:41:20PM +0100, marcandre.lureau@redhat.com= wrote: > > > From: Marc-Andr=E9 Lureau > > >=20 > > > The prepare callback needs to be implemented with glib < 2.36. > > >=20 > > > Signed-off-by: Marc-Andr=E9 Lureau > >=20 > > But nothing prevents us from implementing it for all versions. >=20 > Sure, it's just a kind of dead code for me that should be removed in fu= ture version. So I prefer to keep it under #ifdef. >=20 > > > --- > > > tests/vhost-user-test.c | 13 ++++++++++++- > > > 1 file changed, 12 insertions(+), 1 deletion(-) > > >=20 > > > diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c > > > index 29205ed..4ab48e4 100644 > > > --- a/tests/vhost-user-test.c > > > +++ b/tests/vhost-user-test.c > > > @@ -506,8 +506,19 @@ test_migrate_source_check(GSource *source) > > > return FALSE; > > > } > > > =20 > > > +#if !GLIB_CHECK_VERSION(2,36,0) > > > +static gboolean > > > +test_migrate_source_prepare(GSource *source, gint *timeout) > > > +{ > > > + *timeout =3D -1; > > > + return FALSE; > > > +} > > > +#endif > > > + > > > GSourceFuncs test_migrate_source_funcs =3D { > > > - NULL, > > > +#if !GLIB_CHECK_VERSION(2,36,0) > > > + test_migrate_source_prepare, > > > +#endif > > > test_migrate_source_check, > >=20 > > So now for version 2.36 check will be used instead of prepare. > > That's clearly wrong. >=20 > instead? > >=20 > > I'll switch this to named initializers to avoid the mess. >=20 > I don't follow what is the mess here. You sent v2 that fixes it, and my patch fixes it too, so we don't need to= argue. >=20 > >=20 > > > NULL, > > > NULL > > > -- > > > 2.5.0 > >=20