diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2013-04-26 02:12:53 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-04-26 20:18:24 +0200 |
commit | 776e7f0f215dd11dde85277723408fae3d319143 (patch) | |
tree | 8347dd6ee07b2e12ae6c25c7c3323889c04b8a96 /pc-bios/s390-ccw | |
parent | 22d67ab55aad82383a0e5628b902a1a0556b2fc9 (diff) | |
download | qemu-776e7f0f215dd11dde85277723408fae3d319143.zip qemu-776e7f0f215dd11dde85277723408fae3d319143.tar.gz qemu-776e7f0f215dd11dde85277723408fae3d319143.tar.bz2 |
s390-ccw.img: Enhance drain_irqs().
- 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>
Diffstat (limited to 'pc-bios/s390-ccw')
-rw-r--r-- | pc-bios/s390-ccw/virtio.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index 1968fc6..1bd17d4 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -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; } } } |