diff options
author | Christian Borntraeger | 2012-04-23 01:52:19 +0200 |
---|---|---|
committer | Alexander Graf | 2012-05-01 21:04:06 +0200 |
commit | cc3c7384ac61728e9949d5e64c10664fe4510179 (patch) | |
tree | 0b13d5afc9963f412f545a893462b21ac91db5db /hw/s390-virtio.c | |
parent | Remove stray HOST_LONG_SIZE (diff) | |
download | qemu-cc3c7384ac61728e9949d5e64c10664fe4510179.tar.gz qemu-cc3c7384ac61728e9949d5e64c10664fe4510179.tar.xz qemu-cc3c7384ac61728e9949d5e64c10664fe4510179.zip |
S390: fix kernel_commandline handling
The current handling of kernel parameters is broken. The pointer
is always valid, even if no -kernel or -append is specified.
We must check if the kernel rom address is valid instead,
otherwise qemu might segfault.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/s390-virtio.c')
-rw-r--r-- | hw/s390-virtio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 1ebe70d0e3..c79784c0c8 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -274,7 +274,7 @@ static void s390_init(ram_addr_t my_ram_size, 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); |