hw/i386: extend pxb query for all PC machines

Add bus property to PC machines and use it when looking
for primary PCI root bus (bus 0).

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
Marcel Apfelbaum 2015-11-26 18:00:28 +02:00 committed by Michael S. Tsirkin
parent 02b07434be
commit 81ed6482a3
5 changed files with 5 additions and 3 deletions

View File

@ -950,8 +950,7 @@ build_ssdt(GArray *table_data, GArray *linker,
/* Reserve space for header */ /* Reserve space for header */
acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader)); acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader));
/* Extra PCI root buses are implemented only for i440fx */ bus = PC_MACHINE(machine)->bus;
bus = find_i440fx();
if (bus) { if (bus) {
QLIST_FOREACH(bus, &bus->child, sibling) { QLIST_FOREACH(bus, &bus->child, sibling) {
uint8_t bus_num = pci_bus_num(bus); uint8_t bus_num = pci_bus_num(bus);

View File

@ -1167,7 +1167,7 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data)
PcGuestInfoState *guest_info_state = container_of(notifier, PcGuestInfoState *guest_info_state = container_of(notifier,
PcGuestInfoState, PcGuestInfoState,
machine_done); machine_done);
PCIBus *bus = find_i440fx(); PCIBus *bus = PC_MACHINE(qdev_get_machine())->bus;
if (bus) { if (bus) {
int extra_hosts = 0; int extra_hosts = 0;

View File

@ -185,6 +185,7 @@ static void pc_init1(MachineState *machine,
pcms->below_4g_mem_size, pcms->below_4g_mem_size,
pcms->above_4g_mem_size, pcms->above_4g_mem_size,
pci_memory, ram_memory); pci_memory, ram_memory);
pcms->bus = pci_bus;
} else { } else {
pci_bus = NULL; pci_bus = NULL;
i440fx_state = NULL; i440fx_state = NULL;

View File

@ -181,6 +181,7 @@ static void pc_q35_init(MachineState *machine)
qdev_init_nofail(DEVICE(q35_host)); qdev_init_nofail(DEVICE(q35_host));
phb = PCI_HOST_BRIDGE(q35_host); phb = PCI_HOST_BRIDGE(q35_host);
host_bus = phb->bus; host_bus = phb->bus;
pcms->bus = phb->bus;
/* create ISA bus */ /* create ISA bus */
lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV, lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV,
ICH9_LPC_FUNC), true, ICH9_LPC_FUNC), true,

View File

@ -51,6 +51,7 @@ struct PCMachineState {
OnOffAuto vmport; OnOffAuto vmport;
OnOffAuto smm; OnOffAuto smm;
ram_addr_t below_4g_mem_size, above_4g_mem_size; ram_addr_t below_4g_mem_size, above_4g_mem_size;
PCIBus *bus;
}; };
#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device" #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"