On Thu, Nov 26, 2015 at 06:00:28PM +0200, Marcel Apfelbaum wrote: > Add bus property to PC machines and use it when looking > for primary PCI root bus (bus 0). > > Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> > --- > hw/i386/acpi-build.c | 3 +-- > hw/i386/pc.c | 2 +- > hw/i386/pc_piix.c | 1 + > hw/i386/pc_q35.c | 1 + > include/hw/i386/pc.h | 1 + > 5 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 736b252..bca3f06 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -950,8 +950,7 @@ build_ssdt(GArray *table_data, GArray *linker, > /* Reserve space for header */ > acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader)); > > - /* Extra PCI root buses are implemented only for i440fx */ > - bus = find_i440fx(); > + bus = PC_MACHINE(machine)->bus;
You can use acpi_get_i386_pci_host()->bus here, so we can reduce the amount of PC-specific code inside acpi-build.c. (Making acpi_get_i386_pci_host() more generic and not depend on piix- and q35-specific checks is also on my plans) > if (bus) { > QLIST_FOREACH(bus, &bus->child, sibling) { > uint8_t bus_num = pci_bus_num(bus); [...] -- Eduardo