From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGpob-0007S9-3J for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGpoS-0006Xo-Ho for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:37 -0400 Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]:59305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGpoS-0006XY-Aj for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:28 -0400 Received: by mail-ee0-f43.google.com with SMTP id e52so2924410eek.2 for ; Tue, 03 Sep 2013 05:34:27 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 3 Sep 2013 14:33:19 +0200 Message-Id: <1378211609-16121-29-git-send-email-pbonzini@redhat.com> In-Reply-To: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> References: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 28/38] xio3130-downstream: reclaim memory in instance_finalize instead of exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com Signed-off-by: Paolo Bonzini --- hw/pci-bridge/xio3130_downstream.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c index 75522c6..3dc6815 100644 --- a/hw/pci-bridge/xio3130_downstream.c +++ b/hw/pci-bridge/xio3130_downstream.c @@ -119,6 +119,12 @@ static void xio3130_downstream_exitfn(PCIDevice *d) pcie_cap_exit(d); msi_uninit(d); pci_bridge_exitfn(d); +} + +static void xio3130_downstream_instance_finalize(Object *obj) +{ + PCIDevice *d = PCI_DEVICE(obj); + pcie_aer_free(d); pci_bridge_free(d); } @@ -186,6 +192,7 @@ static const TypeInfo xio3130_downstream_info = { .name = "xio3130-downstream", .parent = TYPE_PCIE_SLOT, .class_init = xio3130_downstream_class_init, + .instance_finalize = xio3130_downstream_instance_finalize, }; static void xio3130_downstream_register_types(void) -- 1.8.3.1