From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Igor Mammedov 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> Subject: [Qemu-devel] [PATCH 06/13] acpi: use TYPE_AML_OBJECT for toplevel ACPI tables blob List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, drjones@redhat.com, zhaoshenglong@huawei.com, claudio.fontana@huawei.com, marcel.a@redhat.com 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); } -- 1.8.3.1