From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUCit-0003Hq-72 for qemu-devel@nongnu.org; Mon, 01 Aug 2016 08:53:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUCio-0001Ob-Rc for qemu-devel@nongnu.org; Mon, 01 Aug 2016 08:53:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUCio-0001OX-JB for qemu-devel@nongnu.org; Mon, 01 Aug 2016 08:53:30 -0400 References: <20160728143808.13707-1-marcandre.lureau@redhat.com> <20160728143808.13707-34-marcandre.lureau@redhat.com> <579A8427.1060306@redhat.com> From: Eric Blake Message-ID: <579F4649.4010304@redhat.com> Date: Mon, 1 Aug 2016 06:53:29 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2Tj6JCc513QiFJWnI3jiBpdcjddIxW8an" Subject: Re: [Qemu-devel] [PATCH v2 33/37] tests: add qtest_add_data_func_full List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: QEMU This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2Tj6JCc513QiFJWnI3jiBpdcjddIxW8an From: Eric Blake To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: QEMU Message-ID: <579F4649.4010304@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 33/37] tests: add qtest_add_data_func_full References: <20160728143808.13707-1-marcandre.lureau@redhat.com> <20160728143808.13707-34-marcandre.lureau@redhat.com> <579A8427.1060306@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/29/2016 02:48 AM, Marc-Andr=C3=A9 Lureau wrote: >>> +#if GLIB_CHECK_VERSION(2, 34, 0) >>> + gchar *path =3D g_strdup_printf("/%s/%s", qtest_get_arch(), str)= ; >>> + g_test_add_data_func_full(path, data, fn, data_free_func); >>> + g_free(path); >>> +#else >>> + qtest_add_data_func(str, data, fn); >>> +#endif >> >> The commit message doesn't mention that the code is dependent on glib >> versions, nor that you are still leaking the data (data_free_func >> remains uncalled) on older glib. If it is intentional (under the >> argument that "anyone running on older glib can't care too much about >> memory leaks encountered only by the testsuite, and the leaks don't >> affect main qemu"), then stating that in the commit message would let = me >> feel more comfortable giving an R-b. >=20 > ok >=20 >> Is there anything we can do even in older glib to unconditionally invo= ke >> the cleanup function in the right places? >=20 > Yes, calling the undocumented g_test_add_vtable(), with some casts. Is > that acceptable? Since the older versions aren't changing, then yes, I would view back-compat casts along with a note saying "remove this once we can require new-enough glib" as acceptable. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --2Tj6JCc513QiFJWnI3jiBpdcjddIxW8an Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXn0ZJAAoJEKeha0olJ0NqhBwH/2gihs3JG7I3fjx3UmqpTcQD 9a/dX1YtxH5kvD0xHa5J9VLT7YwHWntcoX2XOWJN/3OQd7RCHjS7vvWU9oPLNJ2q Y5E2D536koCNhjy3PhsHoG9/WfapoKX+il+fePpPCdBCPbPufBzNEyBzT4aOZ9ip gVYG8Aajfd16QbO5k3KzJ7AXPwA5VxOOUoLVIrZD5gyCUgH5jJVlqcFrDhvzs2C5 94EhIfdvjAPFjFeVX6uD3lwRvkKs9usft3AqPIkPYTp+N+n6zgCrXXKX3SQ/YAp3 B4KINglsGUeaYqRtYXRE2OtdUp0p+Z9E79EwoQMk4y4aRK+Lhrw7bfyC14NNgJ0= =fnUo -----END PGP SIGNATURE----- --2Tj6JCc513QiFJWnI3jiBpdcjddIxW8an--