Patchwork [1/7] s390x: fix -initrd in virtio machine

login
register
mail settings
Submitter Alexander Graf
Date Oct. 29, 2012, 6:40 p.m.
Message ID <1351536024-27536-2-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/195113/
State New
Headers show

Comments

Alexander Graf - Oct. 29, 2012, 6:40 p.m.
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>
---
 hw/s390-virtio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index 85bd13e..52fad37 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)) {