[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/32] s390x/pci: clean up s390 PCI groups
From: |
Alex Williamson |
Subject: |
[PULL 27/32] s390x/pci: clean up s390 PCI groups |
Date: |
Mon, 26 Oct 2020 13:36:11 -0600 |
User-agent: |
StGit/0.21-dirty |
From: Matthew Rosato <mjrosato@linux.ibm.com>
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>
Signed-off-by: Alex Williamson <alex.williamson@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 4c7f06d5cf95..036cf4635a7e 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;
- [PULL 17/32] qapi: Add VFIO devices migration stats in Migration stats, (continued)
- [PULL 17/32] qapi: Add VFIO devices migration stats in Migration stats, Alex Williamson, 2020/10/26
- [PULL 19/32] linux-headers: update against 5.10-rc1, Alex Williamson, 2020/10/26
- [PULL 18/32] update-linux-headers: Add vfio_zdev.h, Alex Williamson, 2020/10/26
- [PULL 20/32] s390x/pci: Move header files to include/hw/s390x, Alex Williamson, 2020/10/26
- [PULL 21/32] vfio: Create shared routine for scanning info capabilities, Alex Williamson, 2020/10/26
- [PULL 22/32] vfio: Find DMA available capability, Alex Williamson, 2020/10/26
- [PULL 23/32] s390x/pci: Add routine to get the vfio dma available count, Alex Williamson, 2020/10/26
- [PULL 24/32] s390x/pci: Honor DMA limits set by vfio, Alex Williamson, 2020/10/26
- [PULL 25/32] s390x/pci: create a header dedicated to PCI CLP, Alex Williamson, 2020/10/26
- [PULL 26/32] s390x/pci: use a PCI Group structure, Alex Williamson, 2020/10/26
- [PULL 27/32] s390x/pci: clean up s390 PCI groups,
Alex Williamson <=
- [PULL 28/32] s390x/pci: use a PCI Function structure, Alex Williamson, 2020/10/26
- [PULL 29/32] vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities, Alex Williamson, 2020/10/26
- [PULL 30/32] s390x/pci: get zPCI function info from host, Alex Williamson, 2020/10/26
- [PULL 31/32] hw/vfio: Use lock guard macros, Alex Williamson, 2020/10/26
- [PULL 32/32] vfio: fix incorrect print type, Alex Williamson, 2020/10/26
- Re: [PULL 00/32] VFIO updates 2020-10-26 (for QEMU 5.2 soft-freeze), Peter Maydell, 2020/10/27