Revision 7e98e3af

b/hw/pci_bridge.c
138 138
           io base/limit upper 16 */
139 139
        ranges_overlap(address, len, PCI_MEMORY_BASE, 20)) {
140 140
        PCIBridge *s = container_of(d, PCIBridge, dev);
141
        PCIBus *secondary_bus = &s->bus;
142
        pci_bridge_update_mappings(secondary_bus);
141
        pci_bridge_update_mappings(&s->sec_bus);
143 142
    }
144 143
}
145 144

  
......
164 163
static int pci_bridge_exitfn(PCIDevice *pci_dev)
165 164
{
166 165
    PCIBridge *s = DO_UPCAST(PCIBridge, dev, pci_dev);
167
    PCIBus *bus = &s->bus;
168
    pci_unregister_secondary_bus(bus);
166
    pci_unregister_secondary_bus(&s->sec_bus);
169 167
    return 0;
170 168
}
171 169

  
......
182 180
    qdev_init_nofail(&dev->qdev);
183 181

  
184 182
    s = DO_UPCAST(PCIBridge, dev, dev);
185
    pci_register_secondary_bus(bus, &s->bus, &s->dev, map_irq, name);
186
    return &s->bus;
183
    pci_register_secondary_bus(bus, &s->sec_bus, &s->dev, map_irq, name);
184
    return &s->sec_bus;
187 185
}
188 186

  
189 187
static PCIDeviceInfo bridge_info = {
b/hw/pci_internals.h
32 32

  
33 33
typedef struct {
34 34
    PCIDevice dev;
35
    PCIBus bus;
35
    PCIBus sec_bus;
36 36
    uint32_t vid;
37 37
    uint32_t did;
38 38
} PCIBridge;

Also available in: Unified diff