From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3MCB-0005RM-Hf for qemu-devel@nongnu.org; Mon, 30 Nov 2015 06:00:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3MC7-0002ut-Fp for qemu-devel@nongnu.org; Mon, 30 Nov 2015 06:00:35 -0500 Received: from mx4-phx2.redhat.com ([209.132.183.25]:43496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3MC7-0002un-6w for qemu-devel@nongnu.org; Mon, 30 Nov 2015 06:00:31 -0500 Date: Mon, 30 Nov 2015 06:00:29 -0500 (EST) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <2065023007.20674130.1448881229487.JavaMail.zimbra@redhat.com> In-Reply-To: <20151130125657-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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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: "Michael S. Tsirkin" Cc: marcandre lureau , qemu-devel@nongnu.org ----- Original Message ----- > On Fri, Nov 27, 2015 at 03:41:20PM +0100, marcandre.lureau@redhat.com wro= te: > > From: Marc-Andr=C3=A9 Lureau > >=20 > > The prepare callback needs to be implemented with glib < 2.36. > >=20 > > Signed-off-by: Marc-Andr=C3=A9 Lureau >=20 > But nothing prevents us from implementing it for all versions. Sure, it's just a kind of dead code for me that should be removed in future= version. So I prefer to keep it under #ifdef. > > --- > > 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. instead? >=20 > I'll switch this to named initializers to avoid the mess. I don't follow what is the mess here. >=20 > > NULL, > > NULL > > -- > > 2.5.0 >=20