qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: cohuck@redhat.com, thuth@redhat.com
Cc: kvm@vger.kernel.org, pmorel@linux.ibm.com, david@redhat.com,
	schnelle@linux.ibm.com, qemu-s390x@nongnu.org,
	qemu-devel@nongnu.org, pasic@linux.ibm.com,
	borntraeger@de.ibm.com, alex.williamson@redhat.com,
	mst@redhat.com, pbonzini@redhat.com, rth@twiddle.net
Subject: [PATCH 5/7] s390x/pci: clean up s390 PCI groups
Date: Sat, 19 Sep 2020 11:34:30 -0400	[thread overview]
Message-ID: <1600529672-10243-6-git-send-email-mjrosato@linux.ibm.com> (raw)
In-Reply-To: <1600529672-10243-1-git-send-email-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>
---
 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 3015d86..d6666c2 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 *grp;
+    S390pciState *s = S390_PCI_HOST_BRIDGE(dev);
+
+    while (!QTAILQ_EMPTY(&s->zpci_grps)) {
+        grp = QTAILQ_FIRST(&s->zpci_grps);
+        QTAILQ_REMOVE(&s->zpci_grps, grp, 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



  parent reply	other threads:[~2020-09-19 15:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-19 15:34 [PATCH 0/7] Retrieve zPCI hardware information from VFIO Matthew Rosato
2020-09-19 15:34 ` [PATCH 1/7] update-linux-headers: Add vfio_zdev.h Matthew Rosato
2020-09-19 15:34 ` [PATCH 2/7] linux-headers: update against 5.9-rc5 Matthew Rosato
2020-09-19 15:34 ` [PATCH 3/7] s390x/pci: create a header dedicated to PCI CLP Matthew Rosato
2020-09-25  9:17   ` Cornelia Huck
2020-09-25 14:10     ` Matthew Rosato
2020-09-25 15:03       ` Cornelia Huck
2020-09-19 15:34 ` [PATCH 4/7] s390x/pci: use a PCI Group structure Matthew Rosato
2020-09-25  9:41   ` Cornelia Huck
2020-09-25 14:17     ` Matthew Rosato
2020-09-19 15:34 ` Matthew Rosato [this message]
2020-09-19 15:34 ` [PATCH 6/7] s390x/pci: use a PCI Function structure Matthew Rosato
2020-09-19 15:34 ` [PATCH 7/7] s390x/pci: get zPCI function info from host Matthew Rosato

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=1600529672-10243-6-git-send-email-mjrosato@linux.ibm.com \
    --to=mjrosato@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=schnelle@linux.ibm.com \
    --cc=thuth@redhat.com \
    /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).