Received: from eggs.gnu.org ([2001:4830:134:3::10]:54018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUBCg-0003pu-0B for qemu-devel@nongnu.org; Thu, 10 Oct 2013 04:02:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUBCa-0007fw-1f for qemu-devel@nongnu.org; Thu, 10 Oct 2013 04:02:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUBCZ-0007fo-QI for qemu-devel@nongnu.org; Thu, 10 Oct 2013 04:02:31 -0400 Date: Thu, 10 Oct 2013 11:04:38 +0300 From: "Michael S. Tsirkin" Message-ID: <1381392240-6133-4-git-send-email-mst@redhat.com> References: <1381392240-6133-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1381392240-6133-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] acpi-build: load tables supplied by user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori Cc: pbonzini@redhat.com, imammedo@redhat.com, afaerber@suse.de, kraxel@redhat.com If user supplies any SSDTs using -acpi, install them in addition to the built-in ones. Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) AcpiMiscInfo misc; AcpiMcfgInfo mcfg; PcPciInfo pci; + uint8_t *u; acpi_get_cpu_info(&cpu); acpi_get_pm_info(&pm); @@ -1092,6 +1093,14 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) 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); -- MST