[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/13] s390x/pci: clean up s390 PCI groups
From: |
Matthew Rosato |
Subject: |
[PATCH 10/13] s390x/pci: clean up s390 PCI groups |
Date: |
Mon, 26 Oct 2020 11:34:38 -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>
Reviewed-by: Cornelia Huck <cohuck@redhat.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 4c7f06d..036cf46 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -813,6 +813,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;
@@ -1171,6 +1182,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 06/13] s390x/pci: Add routine to get the vfio dma available count, (continued)
- [PATCH 06/13] s390x/pci: Add routine to get the vfio dma available count, Matthew Rosato, 2020/10/26
- [PATCH 07/13] s390x/pci: Honor DMA limits set by vfio, Matthew Rosato, 2020/10/26
- [PATCH 08/13] s390x/pci: create a header dedicated to PCI CLP, Matthew Rosato, 2020/10/26
- [PATCH 11/13] s390x/pci: use a PCI Function structure, Matthew Rosato, 2020/10/26
- [PATCH 02/13] linux-headers: update against 5.10-rc1, Matthew Rosato, 2020/10/26
- [PATCH 12/13] vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities, Matthew Rosato, 2020/10/26
- [PATCH 01/13] update-linux-headers: Add vfio_zdev.h, Matthew Rosato, 2020/10/26
- [PATCH 09/13] s390x/pci: use a PCI Group structure, Matthew Rosato, 2020/10/26
- [PATCH 10/13] s390x/pci: clean up s390 PCI groups,
Matthew Rosato <=
- [PATCH 13/13] s390x/pci: get zPCI function info from host, Matthew Rosato, 2020/10/26
- Re: [PATCH 00/13] s390x/pci: s390-pci updates for kernel 5.10-rc1, Cornelia Huck, 2020/10/26