acpi-build: load tables supplied by user
If user supplies any SSDTs using -acpi,
install them in addition to the built-in ones.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 262d1d6..6cfa044 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1041,6 +1041,7 @@
AcpiMiscInfo misc;
AcpiMcfgInfo mcfg;
PcPciInfo pci;
+ uint8_t *u;
acpi_get_cpu_info(&cpu);
acpi_get_pm_info(&pm);
@@ -1092,6 +1093,14 @@
build_mcfg_q35(tables->table_data, tables->linker, &mcfg);
}
+ /* Add tables supplied by user (if any) */
+ for (u = acpi_table_first(); u; u = acpi_table_next(u)) {
+ unsigned len = acpi_table_len(u);
+
+ acpi_add_table(table_offsets, tables->table_data);
+ g_array_append_vals(tables->table_data, u, len);
+ }
+
/* RSDT is pointed to by RSDP */
rsdt = tables->table_data->len;
build_rsdt(tables->table_data, tables->linker, table_offsets);