diff options
author | Michael S. Tsirkin | 2015-01-28 17:30:38 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2015-02-26 13:04:08 +0100 |
commit | a20275fa502f57a50517d31c6b770e0eeff8feca (patch) | |
tree | 2903ef3ac5772323ac13f823d55704803341218c /hw/i386/acpi-build.c | |
parent | virtio: add feature checking helpers (diff) | |
download | qemu-a20275fa502f57a50517d31c6b770e0eeff8feca.tar.gz qemu-a20275fa502f57a50517d31c6b770e0eeff8feca.tar.xz qemu-a20275fa502f57a50517d31c6b770e0eeff8feca.zip |
acpi-build: skip hotplugged bridges
hotplugged bridges don't get bsel allocated so acpi hotplug doesn't work
for them anyway. OTOH adding them in ACPI creates a host of problems,
e.g. they can't be hot-unplugged themselves which is surprising to
users.
So let's just skip these.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386/acpi-build.c')
-rw-r--r-- | hw/i386/acpi-build.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 9b11c927b5..fa7e52a4d0 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -699,8 +699,10 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state) /* * Skip bridge subtree creation if bridge hotplug is disabled * to make acpi tables compatible with legacy machine types. + * Skip creation for hotplugged bridges as well. */ - if (!child->pcihp_bridge_en && bus->parent_dev) { + if (bus->parent_dev && (!child->pcihp_bridge_en || + DEVICE(bus->parent_dev)->hotplugged)) { build_free_array(bus_table); build_pci_bus_state_cleanup(child); g_free(child); @@ -757,8 +759,10 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state) /* When hotplug for bridges is enabled, bridges are * described in ACPI separately (see build_pci_bus_end). * In this case they aren't themselves hot-pluggable. + * Hotplugged bridges *are* hot-pluggable. */ - bridge_in_acpi = pc->is_bridge && child->pcihp_bridge_en; + bridge_in_acpi = pc->is_bridge && child->pcihp_bridge_en && + !DEVICE(pdev)->hotplugged; if (pc->class_id == PCI_CLASS_BRIDGE_ISA || bridge_in_acpi) { set_bit(slot, slot_device_system); |