qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: peter.maydell@linaro.org
Cc: borntraeger@de.ibm.com, qemu-devel@nongnu.org, agraf@suse.de,
	David Hildenbrand <dahi@linux.vnet.ibm.com>,
	jfrei@linux.vnet.ibm.com,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [Qemu-devel] [PULL 5/9] s390x: unify device reset during subsystem_reset()
Date: Tue, 20 Oct 2015 17:00:21 +0200	[thread overview]
Message-ID: <1445353225-16775-6-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1445353225-16775-1-git-send-email-cornelia.huck@de.ibm.com>

From: David Hildenbrand <dahi@linux.vnet.ibm.com>

We have to manually reset several devices that are not on a bus: Let's
collect them in an array.

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/s390x/s390-virtio-ccw.c | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index b9033d4..14b095f 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -35,26 +35,23 @@ typedef struct S390CcwMachineState {
     bool dea_key_wrap;
 } S390CcwMachineState;
 
+const char const *reset_dev_types[] = {
+    "virtual-css-bridge",
+    "s390-sclp-event-facility",
+    "s390-flic",
+    "diag288",
+};
+
 void subsystem_reset(void)
 {
-    DeviceState *css, *sclp, *flic, *diag288;
+    DeviceState *dev;
+    int i;
 
-    css = DEVICE(object_resolve_path_type("", "virtual-css-bridge", NULL));
-    if (css) {
-        qdev_reset_all(css);
-    }
-    sclp = DEVICE(object_resolve_path_type("",
-                  "s390-sclp-event-facility", NULL));
-    if (sclp) {
-        qdev_reset_all(sclp);
-    }
-    flic = DEVICE(object_resolve_path_type("", "s390-flic", NULL));
-    if (flic) {
-        qdev_reset_all(flic);
-    }
-    diag288 = DEVICE(object_resolve_path_type("", "diag288", NULL));
-    if (diag288) {
-        qdev_reset_all(diag288);
+    for (i = 0; i < ARRAY_SIZE(reset_dev_types); i++) {
+        dev = DEVICE(object_resolve_path_type("", reset_dev_types[i], NULL));
+        if (dev) {
+            qdev_reset_all(dev);
+        }
     }
 }
 
-- 
2.6.2

  parent reply	other threads:[~2015-10-20 15:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20 15:00 [Qemu-devel] [PULL 0/9] Next set of s390x patches Cornelia Huck
2015-10-20 15:00 ` [Qemu-devel] [PULL 1/9] util/qemu-config: fix missing machine command line options Cornelia Huck
2015-10-20 15:00 ` [Qemu-devel] [PULL 2/9] s390x/virtio-ccw: fix 2.4 virtio compat Cornelia Huck
2015-10-20 15:00 ` [Qemu-devel] [PULL 3/9] s390x/kvm: Fix vector validity bit in device machine checks Cornelia Huck
2015-10-20 15:00 ` [Qemu-devel] [PULL 4/9] s390x: flagify mcic values Cornelia Huck
2015-10-20 15:00 ` Cornelia Huck [this message]
2015-10-20 15:00 ` [Qemu-devel] [PULL 6/9] s390x/ipl: we always have an ipl device Cornelia Huck
2015-10-20 15:00 ` [Qemu-devel] [PULL 7/9] s390x: machine reset function with new ipl cpu handling Cornelia Huck
2015-10-20 15:00 ` [Qemu-devel] [PULL 8/9] s390x: reset crypto only on clear reset and QEMU reset Cornelia Huck
2015-10-20 15:00 ` [Qemu-devel] [PULL 9/9] s390x/cmma: clean up cmma reset Cornelia Huck
2015-10-20 15:35 ` [Qemu-devel] [PULL 0/9] Next set of s390x patches Peter Maydell
2015-10-20 16:50   ` Cornelia Huck
2015-10-21  7:04     ` David Hildenbrand
2015-10-20 19:01   ` Christian Borntraeger

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=1445353225-16775-6-git-send-email-cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).