From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpZiO-0006PC-Ek for qemu-devel@nongnu.org; Tue, 05 May 2015 06:04:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpZiL-0002L0-9h for qemu-devel@nongnu.org; Tue, 05 May 2015 06:04:36 -0400 Date: Tue, 5 May 2015 17:56:08 +1000 From: David Gibson Message-ID: <20150505075608.GX14090@voom.redhat.com> References: <1430335224-6716-1-git-send-email-mdroth@linux.vnet.ibm.com> <1430335224-6716-2-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SqGHvGqRphKoTacN" Content-Disposition: inline In-Reply-To: <1430335224-6716-2-git-send-email-mdroth@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH 01/15] pci: allow cleanup/unregistration of PCI buses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: "Michael S. Tsirkin" , aik@ozlabs.ru, qemu-devel@nongnu.org, Paolo Bonzini , qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com --SqGHvGqRphKoTacN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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(). >=20 > 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: >=20 > 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() >=20 > 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. >=20 > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Signed-off-by: Michael Roth Reviewed-by: David Gibson 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. --=20 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 --SqGHvGqRphKoTacN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVSHeYAAoJEGw4ysog2bOSBOoP/A+3e0E+k9gWDj5FVDPWpiQ2 gFi6+Bhwwnw4FksP2W/h86Y1CiqOXZ53ubhdgC3DntoNDoh5cRpp5bV8/Yznan5z id/qvKb43R77Fj6IgOmvDfTIxXWSLzvqi9JPeHfNt87BMHFDa8N03VF9KRphzvfR 7DC2d3Ld3MnxFgpQlT8GgEn2VcL+tmyKpm+mMh5UBdxKMPJC3uNG3oCsN8pcAWrb hXTfw6GLS+Fc6EWzHymsEylR7iyIfrXrsm5UgRKcMPOC/AA6RoDWqUT/eKVRNZhS IMvrYA6WY75Fa0SPjRgkeKmEJDbj262erfAIONw0jnxfgoY08xu5HhChnYxC0ZMQ xpp/8q+oBwwonkeiHaZJR50QblIkW+bHn/GBulLXFbzSw6yMRoSZqXGe/z64mSZU RxZFEoE8o20TN+zpbH/8D6N2oSxR7PiGkfuAxpDars/q4LjCy66IBepFpKKMHsK9 6vvLsbh/pZU+q171Bin8GqIaxl1w8EbQvVmIQTYnH+niiAMsCfBdWsNrNXoV/2eY tsiE5YXZrdIoH3ZZnOavEfqONDNOH54SzrJrc2SnbNvdoYFFpJ3McK+Wc7a6oePx 83miZ+Mhf/6VYnoD86cmDv2vveQLXVMMdVB5IRL8EHhsSbtKHzF9Hh3IYyqfHYUQ dosfjS+/XsYeM7LnI2v1 =p+7T -----END PGP SIGNATURE----- --SqGHvGqRphKoTacN--