From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3MAD-0004Hb-RG for qemu-devel@nongnu.org; Mon, 30 Nov 2015 05:58:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3MA9-0001p9-Q9 for qemu-devel@nongnu.org; Mon, 30 Nov 2015 05:58:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3MA9-0001oh-Lp for qemu-devel@nongnu.org; Mon, 30 Nov 2015 05:58:29 -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 93C90C0D222B for ; Mon, 30 Nov 2015 10:58:28 +0000 (UTC) Date: Mon, 30 Nov 2015 12:58:26 +0200 From: "Michael S. Tsirkin" Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1448635280-941-4-git-send-email-marcandre.lureau@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: marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org On Fri, Nov 27, 2015 at 03:41:20PM +0100, marcandre.lureau@redhat.com wro= te: > 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 But nothing prevents us from implementing it for all versions. > --- > 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, So now for version 2.36 check will be used instead of prepare. That's clearly wrong. I'll switch this to named initializers to avoid the mess. > NULL, > NULL > --=20 > 2.5.0