qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com
Subject: [Qemu-devel] [PATCH 26/39] pcie_aer: pcie_aer_exit really frees stuff
Date: Tue,  4 Jun 2013 20:52:21 +0200	[thread overview]
Message-ID: <1370371954-8479-27-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1370371954-8479-1-git-send-email-pbonzini@redhat.com>

Rename it, and move its call towards the end to prepare for
unrealize/instance_finalize split.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/pci-bridge/ioh3420.c            | 2 +-
 hw/pci-bridge/xio3130_downstream.c | 2 +-
 hw/pci-bridge/xio3130_upstream.c   | 2 +-
 hw/pci/pcie_aer.c                  | 3 ++-
 include/hw/pci/pcie_aer.h          | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c
index 74ab7c8..0a3cbb7 100644
--- a/hw/pci-bridge/ioh3420.c
+++ b/hw/pci-bridge/ioh3420.c
@@ -153,11 +153,11 @@ static void ioh3420_exitfn(PCIDevice *d)
     PCIEPort *p = DO_UPCAST(PCIEPort, br, br);
     PCIESlot *s = DO_UPCAST(PCIESlot, port, p);
 
-    pcie_aer_exit(d);
     pcie_chassis_del_slot(s);
     pcie_cap_exit(d);
     msi_uninit(d);
     pci_bridge_exitfn(d);
+    pcie_aer_free(d);
     pci_bridge_free(d);
 }
 
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
index 57af725..6ff336f 100644
--- a/hw/pci-bridge/xio3130_downstream.c
+++ b/hw/pci-bridge/xio3130_downstream.c
@@ -118,11 +118,11 @@ static void xio3130_downstream_exitfn(PCIDevice *d)
     PCIEPort *p = DO_UPCAST(PCIEPort, br, br);
     PCIESlot *s = DO_UPCAST(PCIESlot, port, p);
 
-    pcie_aer_exit(d);
     pcie_chassis_del_slot(s);
     pcie_cap_exit(d);
     msi_uninit(d);
     pci_bridge_exitfn(d);
+    pcie_aer_free(d);
     pci_bridge_free(d);
 }
 
diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
index 58c3d29..9485f5e 100644
--- a/hw/pci-bridge/xio3130_upstream.c
+++ b/hw/pci-bridge/xio3130_upstream.c
@@ -101,10 +101,10 @@ err_bridge:
 
 static void xio3130_upstream_exitfn(PCIDevice *d)
 {
-    pcie_aer_exit(d);
     pcie_cap_exit(d);
     msi_uninit(d);
     pci_bridge_exitfn(d);
+    pcie_aer_free(d);
     pci_bridge_free(d);
 }
 
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index 1ce72ce..7db4e8e 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -163,9 +163,10 @@ int pcie_aer_init(PCIDevice *dev, uint16_t offset)
     return 0;
 }
 
-void pcie_aer_exit(PCIDevice *dev)
+void pcie_aer_free(PCIDevice *dev)
 {
     g_free(dev->exp.aer_log.log);
+    dev->exp.aer_log.log = NULL;
 }
 
 static void pcie_aer_update_uncor_status(PCIDevice *dev)
diff --git a/include/hw/pci/pcie_aer.h b/include/hw/pci/pcie_aer.h
index bcac80a..af1dec3 100644
--- a/include/hw/pci/pcie_aer.h
+++ b/include/hw/pci/pcie_aer.h
@@ -88,7 +88,7 @@ struct PCIEAERErr {
 extern const VMStateDescription vmstate_pcie_aer_log;
 
 int pcie_aer_init(PCIDevice *dev, uint16_t offset);
-void pcie_aer_exit(PCIDevice *dev);
+void pcie_aer_free(PCIDevice *dev);
 void pcie_aer_write_config(PCIDevice *dev,
                            uint32_t addr, uint32_t val, int len);
 
-- 
1.8.1.4

  parent reply	other threads:[~2013-06-04 18:53 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 18:51 [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize Paolo Bonzini
2013-06-04 18:51 ` [Qemu-devel] [PATCH 01/39] scsi: keep device alive while it has requests Paolo Bonzini
2013-06-07  7:48   ` Andreas Färber
2013-06-07 14:01     ` Anthony Liguori
2013-06-04 18:51 ` [Qemu-devel] [PATCH 02/39] dma: keep a device alive while it has SGLists Paolo Bonzini
2013-06-07  7:50   ` Andreas Färber
2013-06-07 14:04     ` Anthony Liguori
2013-06-04 18:51 ` [Qemu-devel] [PATCH 03/39] pci: split exit and finalize Paolo Bonzini
2013-06-07 14:05   ` Anthony Liguori
2013-06-04 18:51 ` [Qemu-devel] [PATCH 04/39] ac97: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 05/39] es1370: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 06/39] hda: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 07/39] serial: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 08/39] tpci200: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 09/39] pci-assign: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 10/39] ahci: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 11/39] msix: split msix_free from msix_uninit Paolo Bonzini
2013-06-04 22:03   ` Michael S. Tsirkin
2013-06-04 22:40     ` Paolo Bonzini
2013-06-05  4:53       ` Michael S. Tsirkin
2013-06-05  7:48         ` Paolo Bonzini
2013-06-05 10:32           ` Michael S. Tsirkin
2013-06-07  1:01             ` Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 12/39] cmd646: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 13/39] ide/piix: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 14/39] ide/via: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 15/39] ivshmem: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 16/39] pci-testdev: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 17/39] vfio: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 18/39] e1000: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 19/39] eepro100: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 20/39] ne2000: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 21/39] pcnet: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 22/39] rtl8139: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 23/39] vmxnet3: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 24/39] shpc: split shpc_free out of shpc_cleanup Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 25/39] pci_bridge: split pci_bridge_free from pci_bridge_exitfn Paolo Bonzini
2013-06-04 18:52 ` Paolo Bonzini [this message]
2013-06-04 18:52 ` [Qemu-devel] [PATCH 27/39] pci_bridge: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 28/39] ioh4320: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 29/39] xio3130-downstream: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 30/39] xio3130-upstream: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 31/39] pcie: do not recreate mmcfg I/O region, use an alias instead Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 32/39] esp: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 33/39] lsi: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 34/39] pvscsi: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 35/39] usb-uhci: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 36/39] virtio-pci: split exit and instance_finalize Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 37/39] wdt_i6300esb: use instance_finalize instead of exit Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 38/39] xen_pt: " Paolo Bonzini
2013-06-04 18:52 ` [Qemu-devel] [PATCH 39/39] tpm: move add/del_subregion to realize/unrealize Paolo Bonzini
2013-06-07  8:02   ` Andreas Färber
2013-06-05  9:50 ` [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize Andreas Färber
2013-06-05 11:10   ` Michael S. Tsirkin
2013-06-05 11:32     ` Andreas Färber
2013-06-05 12:06       ` Michael S. Tsirkin
2013-06-05 12:23         ` Andreas Färber
2013-06-05 12:36           ` Michael S. Tsirkin
2013-06-05 12:47             ` Andreas Färber
2013-06-05 11:38     ` Peter Maydell
2013-06-05 12:02       ` Michael S. Tsirkin
2013-06-05 12:15       ` Michael S. Tsirkin
2013-06-05 12:53     ` Anthony Liguori
2013-06-05 14:27       ` Michael S. Tsirkin
2013-06-05 15:33         ` Anthony Liguori
2013-06-05 15:44           ` Michael S. Tsirkin
2013-06-05 15:48             ` Peter Maydell
2013-06-07  1:03   ` Paolo Bonzini
2013-06-07  7:45     ` Andreas Färber
2013-06-07 12:13       ` Paolo Bonzini
2013-06-07  8:41     ` Peter Crosthwaite
2013-06-07 13:25       ` Andreas Färber
2013-06-05 15:36 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370371954-8479-27-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).