From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4Uco-0004xj-RO for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4Ucl-0007Ri-1H for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4Uck-0007RI-Sk for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:42 -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 (Postfix) with ESMTPS id 7A0E9C07753B for ; Thu, 3 Dec 2015 14:12:42 +0000 (UTC) From: Eduardo Habkost Date: Wed, 2 Dec 2015 20:22:56 -0200 Message-Id: <1449094978-22986-12-git-send-email-ehabkost@redhat.com> In-Reply-To: <1449094978-22986-1-git-send-email-ehabkost@redhat.com> References: <1449094978-22986-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 11/13] acpi: Don't use find_i440fx() when setting bsel properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , Marcel Apfelbaum , "Michael S. Tsirkin" Instead of checking for i440fx, the code can simply check if the machine has ACPI PCI hotplug enabled. Signed-off-by: Eduardo Habkost --- hw/i386/acpi-build.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 585100f..048967e 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -397,12 +397,12 @@ static void *acpi_set_bsel(PCIBus *bus, void *opaque) return bsel_alloc; } -static void acpi_set_pci_info(void) +static void acpi_set_pci_info(PCMachineState *pcms) { - PCIBus *bus = find_i440fx(); /* TODO: Q35 support */ + PCIBus *bus = pcms->bus; unsigned bsel_alloc = 0; - if (bus) { + if (acpi_pci_hotplug_enabled(pcms) && bus) { /* Scan all PCI buses. Set property to enable acpi based hotplug. */ pci_for_each_bus_depth_first(bus, acpi_set_bsel, NULL, &bsel_alloc); } @@ -1855,7 +1855,7 @@ void acpi_setup(PCMachineState *pcms) build_state->pcms = pcms; - acpi_set_pci_info(); + acpi_set_pci_info(pcms); acpi_build_tables_init(&tables); acpi_build(build_state->pcms, &tables); -- 2.1.0