summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorCollin Walling <walling@linux.ibm.com>2018-04-16 12:56:08 -0400
committerThomas Huth <thuth@redhat.com>2018-05-02 11:27:14 +0200
commit074afe60d4c8167dcfaee7aca1065c6360449eaa (patch)
tree4d860243718b454f3ac3501d10b90e8b04a40898 /hw
parent6df2a829dfacfbf10a78199ad4b023a7ea65d9cd (diff)
downloadqemu-074afe60d4c8167dcfaee7aca1065c6360449eaa.tar.gz
pc-bios/s390-ccw: fix loadparm initialization and int conversion
Rename the loadparm char array in main.c to loadparm_str and increased the size by one byte to account for a null termination when converting the loadparm string to an int via atoui. We also allow the boot menu to be enabled when loadparm is set to an empty string or a series of spaces. Signed-off-by: Collin Walling <walling@linux.ibm.com> Reported-by: Vasily Gorbik <gor@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/s390x/ipl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index fb554ab156..150f6c0582 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -373,6 +373,10 @@ int s390_ipl_set_loadparm(uint8_t *loadparm)
loadparm[i] = ascii2ebcdic[(uint8_t) lp[i]];
}
+ if (i < 8) {
+ memset(loadparm + i, 0x40, 8 - i); /* fill with EBCDIC spaces */
+ }
+
g_free(lp);
return 0;
}