From: Alexander Graf Date: Wed, 19 Sep 2012 15:24:46 +0000 (+0200) Subject: s390x: fix -initrd in virtio machine X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=235a3f0bed3584fe65079ffa07c7a842971f261e;p=qemu.git s390x: fix -initrd in virtio machine When using -initrd in the virtio machine, we need to indicate the initrd start and size inside the kernel image. These parameters need to be stored in native endianness. Signed-off-by: Alexander Graf Acked-by: Richard Henderson Acked-by: Christian Borntraeger --- diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 85bd13e06f..52fad37526 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -285,8 +285,8 @@ static void s390_init(QEMUMachineInitArgs *args) } /* 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); + stq_p(rom_ptr(INITRD_PARM_START), initrd_offset); + stq_p(rom_ptr(INITRD_PARM_SIZE), initrd_size); } if (rom_ptr(KERN_PARM_AREA)) {