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 <imamm...@redhat.com> --- 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