[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 26/39] pcie_aer: pcie_aer_exit really frees stuff
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 26/39] pcie_aer: pcie_aer_exit really frees stuff |
Date: |
Tue, 4 Jun 2013 20:52:21 +0200 |
Rename it, and move its call towards the end to prepare for
unrealize/instance_finalize split.
Signed-off-by: Paolo Bonzini <address@hidden>
---
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
- [Qemu-devel] [PATCH 16/39] pci-testdev: use instance_finalize instead of exit, (continued)
- [Qemu-devel] [PATCH 16/39] pci-testdev: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 17/39] vfio: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 18/39] e1000: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 19/39] eepro100: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 20/39] ne2000: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 21/39] pcnet: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 22/39] rtl8139: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 23/39] vmxnet3: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 24/39] shpc: split shpc_free out of shpc_cleanup, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 25/39] pci_bridge: split pci_bridge_free from pci_bridge_exitfn, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 26/39] pcie_aer: pcie_aer_exit really frees stuff,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 27/39] pci_bridge: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 28/39] ioh4320: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 29/39] xio3130-downstream: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 30/39] xio3130-upstream: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 31/39] pcie: do not recreate mmcfg I/O region, use an alias instead, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 32/39] esp: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 33/39] lsi: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 34/39] pvscsi: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 35/39] usb-uhci: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 36/39] virtio-pci: split exit and instance_finalize, Paolo Bonzini, 2013/06/04