From patchwork Tue Mar 3 16:43:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 445805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BAE6A14008F for ; Wed, 4 Mar 2015 03:44:00 +1100 (AEDT) Received: from localhost ([::1]:39660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSpvK-00083k-LM for incoming@patchwork.ozlabs.org; Tue, 03 Mar 2015 11:43:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSpv0-0007Ok-1a for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:43:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSpux-00068O-8u for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:43:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSpux-00068B-1Q for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:43:35 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t23GhWIx013215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Mar 2015 11:43:33 -0500 Received: from redhat.com (dhcp-4-119.tlv.redhat.com [10.35.4.119]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t23GhU2e026718; Tue, 3 Mar 2015 11:43:31 -0500 Date: Tue, 3 Mar 2015 17:43:30 +0100 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1425400953-18482-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Igor Mammedov Subject: [Qemu-devel] [PATCH] aml-build: fix build for glib < 2.22 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org g_ptr_array_new_with_free_func is there since glib 2.22, use the older g_ptr_array_foreach instead. Reported-by: Peter Maydell Signed-off-by: Michael S. Tsirkin Reviewed-by: Igor Mammedov --- Seems to work ok here. Igor - can you pls confirm? hw/acpi/aml-build.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 3e5949b..876cada 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -299,7 +299,7 @@ static Aml *aml_bundle(uint8_t op, AmlBlockFlags flags) return var; } -static void aml_free(gpointer data) +static void aml_free(gpointer data, gpointer user_data) { Aml *var = data; build_free_array(var->buf); @@ -310,13 +310,14 @@ Aml *init_aml_allocator(void) Aml *var; assert(!alloc_list); - alloc_list = g_ptr_array_new_with_free_func(aml_free); + alloc_list = g_ptr_array_new(); var = aml_alloc(); return var; } void free_aml_allocator(void) { + g_ptr_array_foreach(alloc_list, aml_free, NULL); g_ptr_array_free(alloc_list, true); alloc_list = 0; }