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 v2 7/9] s390x/pci: clean up s390 PCI groups
Date: Fri,  2 Oct 2020 16:06:29 -0400	[thread overview]
Message-ID: <1601669191-6731-8-git-send-email-mjrosato@linux.ibm.com> (raw)
In-Reply-To: <1601669191-6731-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 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



  parent reply	other threads:[~2020-10-02 20:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 20:06 [PATCH v2 0/9] Retrieve zPCI hardware information from VFIO Matthew Rosato
2020-10-02 20:06 ` [PATCH v2 1/9] s390x/pci: Move header files to include/hw/s390x Matthew Rosato
2020-10-06 15:32   ` Cornelia Huck
2020-10-06 16:43     ` Matthew Rosato
2020-10-06 17:33       ` Richard Henderson
2020-10-06 17:38         ` Matthew Rosato
2020-10-07  7:35         ` Paolo Bonzini
2020-10-02 20:06 ` [PATCH v2 2/9] MAINTAINERS: Update s390 PCI entry to include headers Matthew Rosato
2020-10-06 15:34   ` Cornelia Huck
2020-10-02 20:06 ` [PATCH v2 3/9] update-linux-headers: Add vfio_zdev.h Matthew Rosato
2020-10-06 15:36   ` Cornelia Huck
2020-10-02 20:06 ` [PATCH v2 4/9] linux-headers: update against 5.9-rc7 Matthew Rosato
2020-10-06 15:39   ` Cornelia Huck
2020-10-06 15:46     ` Matthew Rosato
2020-10-02 20:06 ` [PATCH v2 5/9] s390x/pci: create a header dedicated to PCI CLP Matthew Rosato
2020-10-06 15:42   ` Cornelia Huck
2020-10-02 20:06 ` [PATCH v2 6/9] s390x/pci: use a PCI Group structure Matthew Rosato
2020-10-02 20:06 ` Matthew Rosato [this message]
2020-10-02 20:06 ` [PATCH v2 8/9] s390x/pci: use a PCI Function structure Matthew Rosato
2020-10-02 20:06 ` [PATCH v2 9/9] 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=1601669191-6731-8-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).