From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLg6p-00019I-RT for qemu-devel@nongnu.org; Sun, 24 Aug 2014 18:18:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLg6l-0000Gm-Jl for qemu-devel@nongnu.org; Sun, 24 Aug 2014 18:17:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLg6l-0000GZ-CD for qemu-devel@nongnu.org; Sun, 24 Aug 2014 18:17:55 -0400 Date: Mon, 25 Aug 2014 00:18:16 +0200 From: "Michael S. Tsirkin" Message-ID: <1408918641-14167-3-git-send-email-mst@redhat.com> References: <1408918641-14167-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1408918641-14167-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 02/11] pci_bridge: manually destroy memory regions within PCIBridgeWindows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Gonglei , Knut Omang , Anthony Liguori , Paolo Bonzini From: Paolo Bonzini The regions are destroyed and recreated on configuration space accesses. We need to destroy them before the containing PCIBridgeWindows object is freed. Reported-by: Gonglei Reported-by: Knut Omang Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci/pci_bridge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index 1307265..40c97b1 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -219,6 +219,12 @@ static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w) static void pci_bridge_region_cleanup(PCIBridge *br, PCIBridgeWindows *w) { + object_unparent(OBJECT(&w->alias_io)); + object_unparent(OBJECT(&w->alias_mem)); + object_unparent(OBJECT(&w->alias_pref_mem)); + object_unparent(OBJECT(&w->alias_vga[QEMU_PCI_VGA_IO_LO])); + object_unparent(OBJECT(&w->alias_vga[QEMU_PCI_VGA_IO_HI])); + object_unparent(OBJECT(&w->alias_vga[QEMU_PCI_VGA_MEM])); g_free(w); } -- MST