diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-07-29 07:30:21 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-07-29 07:30:21 -0500 |
commit | b0a71c3b397b12db727ce483f01b3336160ef6a1 (patch) | |
tree | 7ee48415239830c788ce4438624c39f6041b3963 /hw | |
parent | f60a0d6ab9ea9ba900ba3936c3471851f28f7bc4 (diff) | |
parent | 867b18db2155c0c99ab767c4ac563e144c85871d (diff) | |
download | qemu-b0a71c3b397b12db727ce483f01b3336160ef6a1.zip qemu-b0a71c3b397b12db727ce483f01b3336160ef6a1.tar.gz qemu-b0a71c3b397b12db727ce483f01b3336160ef6a1.tar.bz2 |
Merge remote-tracking branch 'agraf/s390-for-upstream' into staging
# By Alexander Graf (1) and others
# Via Alexander Graf
* agraf/s390-for-upstream:
s390: update s390-ccw.img
s390/ipl: Fix boot order
s390/IPL: Allow boot from other ssid than 0
Message-id: 1375092324-23943-1-git-send-email-agraf@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/s390x/ipl.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 0aeb003..d69adb2 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -154,17 +154,19 @@ static void s390_ipl_reset(DeviceState *dev) env->psw.mask = IPL_PSW_MASK; if (!ipl->kernel) { - /* booting firmware, tell what device to boot from */ + /* Tell firmware, if there is a preferred boot device */ + env->regs[7] = -1; DeviceState *dev_st = get_boot_device(0); - VirtioCcwDevice *ccw_dev = (VirtioCcwDevice *) object_dynamic_cast( - OBJECT(&(dev_st->parent_obj)), "virtio-blk-ccw"); - - if (ccw_dev) { - env->regs[7] = ccw_dev->sch->cssid << 24 | - ccw_dev->sch->ssid << 16 | - ccw_dev->sch->devno; - } else { - env->regs[7] = -1; + if (dev_st) { + VirtioCcwDevice *ccw_dev = (VirtioCcwDevice *) object_dynamic_cast( + OBJECT(qdev_get_parent_bus(dev_st)->parent), + TYPE_VIRTIO_CCW_DEVICE); + + if (ccw_dev) { + env->regs[7] = ccw_dev->sch->cssid << 24 | + ccw_dev->sch->ssid << 16 | + ccw_dev->sch->devno; + } } } |