From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpCgw-0006V3-OI for qemu-devel@nongnu.org; Mon, 04 May 2015 05:29:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpCgw-0008Hm-1l for qemu-devel@nongnu.org; Mon, 04 May 2015 05:29:34 -0400 Message-ID: <55473BEA.6020403@redhat.com> Date: Mon, 04 May 2015 11:29:14 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430335224-6716-1-git-send-email-mdroth@linux.vnet.ibm.com> <1430335224-6716-6-git-send-email-mdroth@linux.vnet.ibm.com> <5542369D.90801@redhat.com> <20150501011829.25451.23595@loki> In-Reply-To: <20150501011829.25451.23595@loki> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 05/15] spapr_pci: add PHB unrealize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth , qemu-devel@nongnu.org Cc: aik@ozlabs.ru, nfont@linux.vnet.ibm.com, david@gibson.dropbear.id.au, qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com On 01/05/2015 03:18, Michael Roth wrote: > Sorry, I mixed up memory regions with memory region alias. Memory region > aliases do a memory_region_ref() on the original MR, similar to > memory_region_add_subregion(), so that's what ends up creating the > reference to the owner/PHB. > > So I think I do need to object_unparent() the 2 MR aliases in realize > (otherwise the PHB doesn't get finalized), but everything else can > get moved to instance_finalize() as you suggested and that seems to > do the trick. Yes, unparenting the aliases in unrealize is okay and in fact may be required to avoid a leak. Patching docs/memory.txt to point it out would be great. :) Paolo