[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/10] s390-ccw.img: Detect devices with stsch.
From: |
Dominik Dingel |
Subject: |
[Qemu-devel] [PATCH 05/10] s390-ccw.img: Detect devices with stsch. |
Date: |
Fri, 26 Apr 2013 14:12:52 +0200 |
From: Cornelia Huck <address@hidden>
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 <address@hidden>
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 67f4987..fd40fa5 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;
--
1.7.9.5
- [Qemu-devel] [PATCH 04/10] S390: check if BIOS is available and create links, (continued)
[Qemu-devel] [PATCH 07/10] s390-ccw.img: Rudimentary error checking., Dominik Dingel, 2013/04/26
[Qemu-devel] [PATCH 05/10] s390-ccw.img: Detect devices with stsch.,
Dominik Dingel <=
[Qemu-devel] [PATCH 10/10] S390: Enabling device and program selection, Dominik Dingel, 2013/04/26
[Qemu-devel] [PATCH 01/10] Common: Add a default bootindex for all applicable devices, Dominik Dingel, 2013/04/26