Commit 16eaedf2668e9b347a59d73346fcc4c764c58348

Authored by Gerd Hoffmann
Committed by Paul Brook
1 parent 042f84d0

qdev/pci: misc fixes.

* fix secondary bus setup.
 * use base->name instead of "FIXME" for device name.
   Yes, the device name is redundant.  Only for drivers converted
   to qdev already though.  Once all drivers are converted we can
   and should kill it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Showing 1 changed file with 3 additions and 2 deletions
hw/pci.c
... ... @@ -134,7 +134,8 @@ PCIBus *pci_register_bus(DeviceState *parent, const char *name,
134 134 static PCIBus *pci_register_secondary_bus(PCIDevice *dev, pci_map_irq_fn map_irq)
135 135 {
136 136 PCIBus *bus;
137   - bus = qemu_mallocz(sizeof(PCIBus));
  137 +
  138 + bus = FROM_QBUS(PCIBus, qbus_create(&pci_bus_info, &dev->qdev, NULL));
138 139 bus->map_irq = map_irq;
139 140 bus->parent_dev = dev;
140 141 bus->next = dev->bus->next;
... ... @@ -890,7 +891,7 @@ static void pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
890 891  
891 892 bus = FROM_QBUS(PCIBus, qdev_get_parent_bus(qdev));
892 893 devfn = qdev_get_prop_int(qdev, "devfn", -1);
893   - pci_dev = do_pci_register_device(pci_dev, bus, "FIXME", devfn,
  894 + pci_dev = do_pci_register_device(pci_dev, bus, base->name, devfn,
894 895 info->config_read, info->config_write);
895 896 assert(pci_dev);
896 897 info->init(pci_dev);
... ...