From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPZfU-0005nc-ED for qemu-devel@nongnu.org; Tue, 19 Jul 2016 14:22:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPZfS-0008Fh-5r for qemu-devel@nongnu.org; Tue, 19 Jul 2016 14:22:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPZfR-0008Fc-TZ for qemu-devel@nongnu.org; Tue, 19 Jul 2016 14:22:54 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6456EC04B317 for ; Tue, 19 Jul 2016 18:22:53 +0000 (UTC) References: <20160719085432.4572-1-marcandre.lureau@redhat.com> <20160719085432.4572-4-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: <578E6FFC.3020309@redhat.com> Date: Tue, 19 Jul 2016 12:22:52 -0600 MIME-Version: 1.0 In-Reply-To: <20160719085432.4572-4-marcandre.lureau@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KGwglaARgOOei5R4pfrK1t1LVAlilHxRo" Subject: Re: [Qemu-devel] [PATCH 03/37] qga: free the whole blacklist List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KGwglaARgOOei5R4pfrK1t1LVAlilHxRo From: Eric Blake To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Message-ID: <578E6FFC.3020309@redhat.com> Subject: Re: [Qemu-devel] [PATCH 03/37] qga: free the whole blacklist References: <20160719085432.4572-1-marcandre.lureau@redhat.com> <20160719085432.4572-4-marcandre.lureau@redhat.com> In-Reply-To: <20160719085432.4572-4-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/19/2016 02:53 AM, marcandre.lureau@redhat.com wrote: > From: Marc-Andr=C3=A9 Lureau >=20 > Free the list, not just the elements. >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > qga/main.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) >=20 > diff --git a/qga/main.c b/qga/main.c > index 4c3b2c7..bb48214 100644 > --- a/qga/main.c > +++ b/qga/main.c > @@ -1175,6 +1175,7 @@ static void config_free(GAConfig *config) > #ifdef CONFIG_FSFREEZE > g_free(config->fsfreeze_hook); > #endif > + g_list_free_full(config->blacklist, g_free); > g_free(config); Won't work. We still allow glib 2.22, but g_list_free_full() was added in 2.28. See also commit ba4dba5, where I had to open-code around the lack of the relative g_queue_free_full(). You can, of course, do a prereq patch that supplies fallbacks for older glib, but it may be easiest to just open-code the additional step of g_list_free(config->blacklist)... > @@ -1310,11 +1311,6 @@ static int run_agent(GAState *s, GAConfig *confi= g) > return EXIT_SUCCESS; > } > =20 > -static void free_blacklist_entry(gpointer entry, gpointer unused) > -{ > - g_free(entry); > -} > - > int main(int argc, char **argv) > { > int ret =3D EXIT_SUCCESS; > @@ -1379,7 +1375,6 @@ end: > if (s->channel) { > ga_channel_free(s->channel); > } > - g_list_foreach(config->blacklist, free_blacklist_entry, NULL); =2E..right here, without deleting any of the existing code. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KGwglaARgOOei5R4pfrK1t1LVAlilHxRo 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/ iQEcBAEBCAAGBQJXjm/8AAoJEKeha0olJ0NqXcoIAIRLuU0e6J/DqE3vW4I18MCm mPVod+yZrMrnzn1w6u81J+llXwzo/1Y9JyCLOGDCyhpLwfDFu6pM4864fQdLu3gG DeDXXcAZOhNeuRZ2viG0Q6YRc+lNDtRkJY1K6lLk3CDqlwLeH9lBQT+WMFHA7fiD kdKm15GB5Gp5LefV/OnpIxpAG5azbKfTZEjU9wGWQquVuhNY4kuInTT/E0q6q6K3 nALjXYVkxz/B/CcQ69GfJKxQq4CTPLB3gm/D44c4KtiQ1jy5occMzJ+z6Dn/LmHc xQhNYuHmRXtcgN0HSndCm59/ZhqFd06Dg8XccUGjQvoBLEU/FC9RuA6xddT9wr4= =bSAJ -----END PGP SIGNATURE----- --KGwglaARgOOei5R4pfrK1t1LVAlilHxRo--