[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC PATCH 01/15] pci: allow cleanup/unregistration of PC
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [RFC PATCH 01/15] pci: allow cleanup/unregistration of PCI buses |
Date: |
Tue, 5 May 2015 17:56:08 +1000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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 <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Signed-off-by: Michael Roth <address@hidden>
Reviewed-by: David Gibson <address@hidden>
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
pgp_ZgunSlIUc.pgp
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-ppc] [RFC PATCH 01/15] pci: allow cleanup/unregistration of PCI buses,
David Gibson <=