]> git.proxmox.com Git - qemu.git/commitdiff
s390-ccw.img: Enhance drain_irqs().
authorCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 26 Apr 2013 02:12:53 +0000 (02:12 +0000)
committerAlexander Graf <agraf@suse.de>
Fri, 26 Apr 2013 18:18:24 +0000 (20:18 +0200)
- Use tpi + tsch to get interrupts.
- Return an error if the irb indicates problems.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
pc-bios/s390-ccw/virtio.c

index 1968fc6619ef6769f49949e831ee9a5256326c5c..1bd17d4781e02efda9cd7547f9165a4304166f80 100644 (file)
@@ -38,12 +38,21 @@ static void virtio_notify(struct subchannel_id schid)
  *             Virtio functions                *
  ***********************************************/
 
-static void drain_irqs(struct subchannel_id schid)
+static int drain_irqs(struct subchannel_id schid)
 {
     struct irb irb = {};
+    int r = 0;
+
     while (1) {
+        /* FIXME: make use of TPI, for that enable subchannel and isc */
         if (tsch(schid, &irb)) {
-            return;
+            /* Might want to differentiate error codes later on. */
+            if (irb.scsw.cstat) {
+                r = -EIO;
+            } else if (irb.scsw.dstat != 0xc) {
+                r = -EIO;
+            }
+            return r;
         }
     }
 }