[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/8] acpi-build: minor code cleanup
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 5/8] acpi-build: minor code cleanup |
Date: |
Tue, 29 Jul 2014 12:48:45 +0200 |
Fix up and add comments to clarify code, plus a trivial
code change for clarity.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/acpi-build.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 779160f..ec86f1b 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -825,9 +825,9 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
bool bus_hotplug_support = false;
/*
- skip bridge subtree creation if bridge hotplug is disabled
- to make it compatible with 1.7 machine type
- */
+ * Skip bridge subtree creation if bridge hotplug is disabled
+ * to make acpi tables compatible with legacy machine types.
+ */
if (!child->pcihp_bridge_en && bus->parent_dev) {
return;
}
@@ -869,6 +869,7 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
PCIDeviceClass *pc;
PCIDevice *pdev = bus->devices[i];
int slot = PCI_SLOT(i);
+ bool bridge_in_acpi;
if (!pdev) {
continue;
@@ -878,8 +879,13 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
pc = PCI_DEVICE_GET_CLASS(pdev);
dc = DEVICE_GET_CLASS(pdev);
- if (pc->class_id == PCI_CLASS_BRIDGE_ISA ||
- (pc->is_bridge && child->pcihp_bridge_en)) {
+ /* 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.
+ */
+ bridge_in_acpi = pc->is_bridge && child->pcihp_bridge_en;
+
+ if (pc->class_id == PCI_CLASS_BRIDGE_ISA || bridge_in_acpi) {
set_bit(slot, slot_device_system);
}
@@ -891,7 +897,7 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
}
}
- if (!dc->hotpluggable || (pc->is_bridge && child->pcihp_bridge_en)) {
+ if (!dc->hotpluggable || bridge_in_acpi) {
clear_bit(slot, slot_hotplug_enable);
}
}
--
MST
- [Qemu-devel] [PULL 0/8] pc migration fixes, Michael S. Tsirkin, 2014/07/29
- [Qemu-devel] [PULL 1/8] acpi-dsdt: procedurally generate _PRT, Michael S. Tsirkin, 2014/07/29
- [Qemu-devel] [PULL 2/8] pc: hack for migration compatibility from QEMU 2.0, Michael S. Tsirkin, 2014/07/29
- [Qemu-devel] [PULL 3/8] bios-tables-test: fix ASL normalization false positive, Michael S. Tsirkin, 2014/07/29
- [Qemu-devel] [PULL 4/8] pc: acpi: generate AML only for PCI0 devices if PCI bridge hotplug is disabled, Michael S. Tsirkin, 2014/07/29
- [Qemu-devel] [PULL 5/8] acpi-build: minor code cleanup,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 6/8] pc: future-proof migration-compatibility of ACPI tables, Michael S. Tsirkin, 2014/07/29
- [Qemu-devel] [PULL 7/8] acpi-build: tweak acpi migration limits, Michael S. Tsirkin, 2014/07/29
- [Qemu-devel] [PULL 8/8] piix: set legacy table size for 1.7, Michael S. Tsirkin, 2014/07/29
- Re: [Qemu-devel] [PULL 0/8] pc migration fixes, Peter Maydell, 2014/07/29