aboutsummaryrefslogtreecommitdiff
path: root/hw/s390-virtio.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-05-01 18:46:39 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-05-01 18:46:39 -0500
commit174210fe70d34a1ac70b98c1e4412934cbee2061 (patch)
tree22360abc6aa355df1e73bf0fdc0a449adf618fb3 /hw/s390-virtio.c
parent725cbc68d0430a8f999256342e300f4f960859cd (diff)
parent4170aea1a77d7adf9e35ab4d3c17086c38ca6c09 (diff)
Merge remote-tracking branch 'agraf/s390-for-upstream' into staging
* agraf/s390-for-upstream: s390: reset avail and used index on reboot S390: dont call system_shutdown on disabled wait S390: remove default cdrom, sd-card and floppy support S390: support reboot for kvm on s390 S390: reboot: reset device pages on reboot S390: fix error handling on kernel and initrd failures S390: fix kernel_commandline handling
Diffstat (limited to 'hw/s390-virtio.c')
-rw-r--r--hw/s390-virtio.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index 1ebe70d0e3..c0e19fd66d 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -99,6 +99,7 @@ int s390_virtio_hypercall(CPUS390XState *env, uint64_t mem, uint64_t hypercall)
virtio_reset(dev->vdev);
stb_phys(dev->dev_offs + VIRTIO_DEV_OFFS_STATUS, 0);
s390_virtio_device_sync(dev);
+ s390_virtio_reset_idx(dev);
break;
}
case KVM_S390_VIRTIO_SET_STATUS:
@@ -230,6 +231,11 @@ static void s390_init(ram_addr_t my_ram_size,
if (kernel_size == -1UL) {
kernel_size = load_image_targphys(kernel_filename, 0, ram_size);
}
+ if (kernel_size == -1UL) {
+ fprintf(stderr, "qemu: could not load kernel '%s'\n",
+ kernel_filename);
+ exit(1);
+ }
/*
* we can not rely on the ELF entry point, since up to 3.2 this
* value was 0x800 (the SALIPL loader) and it wont work. For
@@ -269,12 +275,18 @@ static void s390_init(ram_addr_t my_ram_size,
}
initrd_size = load_image_targphys(initrd_filename, initrd_offset,
ram_size - initrd_offset);
+ if (initrd_size == -1UL) {
+ fprintf(stderr, "qemu: could not load initrd '%s'\n",
+ initrd_filename);
+ exit(1);
+ }
+
/* we have to overwrite values in the kernel image, which are "rom" */
memcpy(rom_ptr(INITRD_PARM_START), &initrd_offset, 8);
memcpy(rom_ptr(INITRD_PARM_SIZE), &initrd_size, 8);
}
- if (kernel_cmdline) {
+ if (rom_ptr(KERN_PARM_AREA)) {
/* we have to overwrite values in the kernel image, which are "rom" */
memcpy(rom_ptr(KERN_PARM_AREA), kernel_cmdline,
strlen(kernel_cmdline) + 1);
@@ -320,8 +332,11 @@ static QEMUMachine s390_machine = {
.alias = "s390",
.desc = "VirtIO based S390 machine",
.init = s390_init,
+ .no_cdrom = 1,
+ .no_floppy = 1,
.no_serial = 1,
.no_parallel = 1,
+ .no_sdcard = 1,
.use_virtcon = 1,
.max_cpus = 255,
.is_default = 1,