[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 07/10] s390x/pci: clean up s390 PCI groups
From: |
Matthew Rosato |
Subject: |
[PATCH v3 07/10] s390x/pci: clean up s390 PCI groups |
Date: |
Wed, 7 Oct 2020 15:04:12 -0400 |
Add a step to remove all stashed PCI groups to avoid stale data between
machine resets.
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
---
hw/s390x/s390-pci-bus.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index c99f2f0..c34f14a 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -811,6 +811,17 @@ static void s390_pcihost_realize(DeviceState *dev, Error
**errp)
S390_ADAPTER_SUPPRESSIBLE, errp);
}
+static void s390_pcihost_unrealize(DeviceState *dev)
+{
+ S390PCIGroup *group;
+ S390pciState *s = S390_PCI_HOST_BRIDGE(dev);
+
+ while (!QTAILQ_EMPTY(&s->zpci_groups)) {
+ group = QTAILQ_FIRST(&s->zpci_groups);
+ QTAILQ_REMOVE(&s->zpci_groups, group, link);
+ }
+}
+
static int s390_pci_msix_init(S390PCIBusDevice *pbdev)
{
char *name;
@@ -1165,6 +1176,7 @@ static void s390_pcihost_class_init(ObjectClass *klass,
void *data)
dc->reset = s390_pcihost_reset;
dc->realize = s390_pcihost_realize;
+ dc->unrealize = s390_pcihost_unrealize;
hc->pre_plug = s390_pcihost_pre_plug;
hc->plug = s390_pcihost_plug;
hc->unplug_request = s390_pcihost_unplug_request;
--
1.8.3.1
- [PATCH v3 00/10] Retrieve zPCI hardware information from VFIO, Matthew Rosato, 2020/10/07
- [PATCH v3 01/10] s390x/pci: Move header files to include/hw/s390x, Matthew Rosato, 2020/10/07
- [PATCH v3 02/10] vfio: Create shared routine for scanning info capabilities, Matthew Rosato, 2020/10/07
- [PATCH v3 03/10] update-linux-headers: Add vfio_zdev.h, Matthew Rosato, 2020/10/07
- [PATCH v3 06/10] s390x/pci: use a PCI Group structure, Matthew Rosato, 2020/10/07
- [PATCH v3 04/10] linux-headers: update against 5.9-rc8, Matthew Rosato, 2020/10/07
- [PATCH v3 05/10] s390x/pci: create a header dedicated to PCI CLP, Matthew Rosato, 2020/10/07
- [PATCH v3 07/10] s390x/pci: clean up s390 PCI groups,
Matthew Rosato <=
- [PATCH v3 08/10] s390x/pci: use a PCI Function structure, Matthew Rosato, 2020/10/07
- [PATCH v3 09/10] vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities, Matthew Rosato, 2020/10/07
- [PATCH v3 10/10] s390x/pci: get zPCI function info from host, Matthew Rosato, 2020/10/07