From patchwork Wed Jan 28 10:03:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 433843 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 8631D14017F for ; Wed, 28 Jan 2015 21:11:53 +1100 (AEDT) Received: from localhost ([::1]:52306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGPbD-0000vV-Ml for incoming@patchwork.ozlabs.org; Wed, 28 Jan 2015 05:11:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGPTt-0004D2-HG for qemu-devel@nongnu.org; Wed, 28 Jan 2015 05:04:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGPTo-0002A7-QL for qemu-devel@nongnu.org; Wed, 28 Jan 2015 05:04:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGPTo-0002A0-IP for qemu-devel@nongnu.org; Wed, 28 Jan 2015 05:04:12 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0SA3s2i010437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Jan 2015 05:03:54 -0500 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0SA3glw003507; Wed, 28 Jan 2015 05:03:53 -0500 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Wed, 28 Jan 2015 10:03:30 +0000 Message-Id: <1422439417-5031-7-git-send-email-imammedo@redhat.com> In-Reply-To: <1422439417-5031-1-git-send-email-imammedo@redhat.com> References: <20150128072757.GA12987@redhat.com> <1422439417-5031-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, drjones@redhat.com, zhaoshenglong@huawei.com, claudio.fontana@huawei.com, marcel.a@redhat.com Subject: [Qemu-devel] [PATCH 06/13] acpi: use TYPE_AML_OBJECT for toplevel ACPI tables blob 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 it allows to use blob with AML API like the rest of AML objects and use object_unref() to destroy it cleaning up all child AML objects that we used for tables construction. Signed-off-by: Igor Mammedov --- hw/i386/acpi-build.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f24f92b..f456f53 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1279,7 +1279,7 @@ struct AcpiBuildTables { static inline void acpi_build_tables_init(AcpiBuildTables *tables) { tables->rsdp = g_array_new(false, true /* clear */, 1); - tables->table_data->buf = g_array_new(false, true /* clear */, 1); + tables->table_data = AML_OBJECT(object_new(TYPE_AML_OBJECT)); tables->tcpalog = g_array_new(false, true /* clear */, 1); tables->linker = bios_linker_loader_init(); tables->table_data->linker = tables->linker; @@ -1290,7 +1290,7 @@ static inline void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre) void *linker_data = bios_linker_loader_cleanup(tables->linker); g_free(linker_data); g_array_free(tables->rsdp, mfre); - g_array_free(tables->table_data->buf, true); + object_unref(OBJECT(tables->table_data)); g_array_free(tables->tcpalog, mfre); }