qemu-e2k/include/hw/pci
Michael Roth c13ee16911 pci: allow cleanup/unregistration of PCI root buses
This adds cleanup counterparts to pci_register_root_bus(),
pci_root_bus_new(), and pci_bus_irqs().

These cleanup routines are needed in the case of hotpluggable
PCIHostBridge implementations. Currently we can rely on the
object_unparent()'ing of the PCIHostState recursively unparenting
and cleaning up it's child buses, but we need explicit calls
to also:

  1) remove the PCIHostState from pci_host_bridges global list.
     otherwise, we risk accessing freed memory when we access
     the list later
  2) clean up memory allocated in pci_bus_irqs()

Both are handled outside the context of any particular bus or
host bridge's init/realize functions, making it difficult to
avoid the need for explicit cleanup functions without remodeling
how PCIHostBridges are created. So keep it simple and just add
them for now.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-01-09 09:28:14 +11:00
..
msi.h pci: Convert msi_init() to Error and fix callers to check it 2016-07-05 13:14:41 +03:00
msix.h pci: Convert msix_init() to Error and fix callers 2017-02-01 03:37:18 +02:00
pci.h pci: allow cleanup/unregistration of PCI root buses 2019-01-09 09:28:14 +11:00
pci_bridge.h pci/shpc: perform unplug via the hotplug handler 2018-12-20 11:19:12 -05:00
pci_bus.h hw/pci: Add missing include 2018-11-05 13:24:02 -05:00
pci_host.h pci: Fold host_buses list into PCIHostState functionality 2013-07-07 23:10:57 +03:00
pci_ids.h i386: clarify that the Q35 machine type implements a P35 chipset 2018-11-06 21:35:05 +01:00
pci_regs.h pci: Introduce define for PM capability version 1.1 2016-06-02 10:42:09 +08:00
pcie.h pci/pcie: perform unplug via the hotplug handler 2018-12-20 11:19:12 -05:00
pcie_aer.h pci: Reduce scope of error injection 2017-05-08 20:32:14 +02:00
pcie_host.h ppc4xx: Add device models found in PPC440 core SoCs 2018-02-16 14:06:07 +11:00
pcie_port.h pcie: Add link speed and width fields to PCIESlot 2018-12-19 16:48:16 -05:00
pcie_regs.h pcie: Create enums for link speed and width 2018-12-19 16:48:16 -05:00
shpc.h pci/shpc: perform unplug via the hotplug handler 2018-12-20 11:19:12 -05:00
slotid_cap.h pci: Convert shpc_init() to Error 2017-07-03 22:29:49 +03:00