On Wed, Apr 29, 2015 at 02:20:10PM -0500, Michael Roth wrote: > This adds cleanup counterparts to pci_register_bus(), > pci_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 <m...@redhat.com> > Cc: Paolo Bonzini <pbonz...@redhat.com> > Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com>
Reviewed-by: David Gibson <da...@gibson.dropbear.id.au> As with Bharata's cpu and memory hotplug series, you may want to split out those patches which are reasonable cleanups regardless of exactly what happens with the hotplug code itself. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
pgpAjgcHZFqMz.pgp
Description: PGP signature