Skip to contentSkip to conversation

s390: fix short kernel command lines

PATCH Applied Christian Borntraeger 2 participants 2 messages Sep 23, 2011 – Oct 4, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390: fix short kernel command lines

The default kernel command line for s390 is
"root=/dev/ram0 ro"

When overriding this line, we have to ensure to also copy the \0 to avoid false lines, for example, -append "root=/dev/vda" will result in "root=/dev/vda0 ro" with the current code.

---
 hw/s390-virtio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390-virtio.c +1 -1
Index: b/hw/s390-virtio.c
===================================================================
@@ -238,7 +238,7 @@ static void s390_init(ram_addr_t my_ram_
 
     if (kernel_cmdline) {
         cpu_physical_memory_write(KERN_PARM_AREA, kernel_cmdline,
-                                  strlen(kernel_cmdline));
+                                  strlen(kernel_cmdline) + 1);
     }
 
     /* Create VirtIO network adapters */
#1 lore raw
Quoted 8 lines · Christian Borntraeger

The default kernel command line for s390 is
"root=/dev/ram0 ro"

When overriding this line, we have to ensure to also copy the \0 to avoid false lines, for example, -append "root=/dev/vda" will result in "root=/dev/vda0 ro" with the current code.

Thanks, applied to s390-next.

Alex