diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2013-04-26 02:12:52 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-04-26 20:18:24 +0200 |
commit | 22d67ab55aad82383a0e5628b902a1a0556b2fc9 (patch) | |
tree | 78792ce67e67aa6a1ecc44f44748ca7df84cb373 /pc-bios/s390-ccw | |
parent | dc03640b5851d3115448493f0eee2b7f539de81a (diff) | |
download | qemu-22d67ab55aad82383a0e5628b902a1a0556b2fc9.tar.gz qemu-22d67ab55aad82383a0e5628b902a1a0556b2fc9.tar.bz2 qemu-22d67ab55aad82383a0e5628b902a1a0556b2fc9.zip |
s390-ccw.img: Detect devices with stsch.
stsch is the canonical way to detect devices. As a bonus, we can
abort the loop if we get cc 3, and we need to check only the valid
devices (dnv set).
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/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 67f4987a85..fd40fa582a 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -22,7 +22,7 @@ void virtio_panic(const char *string) static void virtio_setup(void) { - struct irb irb; + struct schib schib; int i; int r; bool found = false; @@ -31,8 +31,11 @@ static void virtio_setup(void) for (i = 0; i < 0x10000; i++) { blk_schid.sch_no = i; - r = tsch(blk_schid, &irb); - if (r != 3) { + r = stsch_err(blk_schid, &schib); + if (r == 3) { + break; + } + if (schib.pmcw.dnv) { if (virtio_is_blk(blk_schid)) { found = true; break; |