]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
s390x: fix -initrd in virtio machine
authorAlexander Graf <agraf@suse.de>
Wed, 19 Sep 2012 15:24:46 +0000 (17:24 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 30 Nov 2012 21:55:22 +0000 (15:55 -0600)
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 <agraf@suse.de>
Acked-by: Richard Henderson <rth@twiddle.net>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
(cherry picked from commit 235a3f0bed3584fe65079ffa07c7a842971f261e)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/s390-virtio.c

index 47eed35da398c7780ee4c42d496a3ed6e618a49c..12ae612bf9ce1680dcc44abbafd4cde2e3d81b02 100644 (file)
@@ -284,8 +284,8 @@ static void s390_init(ram_addr_t my_ram_size,
         }
 
         /* 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)) {