qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 11/13] acpi: Don't use find_i440fx() when setting bs


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 11/13] acpi: Don't use find_i440fx() when setting bsel properties
Date: Wed, 2 Dec 2015 20:22:56 -0200

Instead of checking for i440fx, the code can simply check if the
machine has ACPI PCI hotplug enabled.

Signed-off-by: Eduardo Habkost <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]