]> git.proxmox.com Git - qemu.git/commit
pci: Simpler implementation of primary PCI bus
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 6 Jun 2013 08:48:52 +0000 (18:48 +1000)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 7 Jul 2013 20:10:57 +0000 (23:10 +0300)
commit9bc473057db773dd24be381ccbde4c686595d2e7
treec0da77accb6351485563acb9dd9a45416acc6b1b
parent29b358f93a48a415853d11fc9b02f711b5ec8f76
pci: Simpler implementation of primary PCI bus

Currently pci_find_primary_bus() searches the list of root buses for one
with domain 0.  But since host buses are always registered with domain 0,
this just amounts to finding the only PCI host bus.  The only remaining
users of pci_find_primary_bus() are in pci-hotplug-old.c, which implements
the old style pci_add/pci_del commands.

Therefore, this patch redefines pci_find_primary_bus() to find the only
PCI root bus, returning an error if there are multiple roots.  The callers
in pci-hotplug-old.c are updated correspondingly, to produce sensible
error messages.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci-hotplug-old.c
hw/pci/pci.c