Skip to content

Commit

Permalink
s390/ipl: only print boot menu error if -boot menu=on was specified
Browse files Browse the repository at this point in the history
It is possible that certain QEMU configurations may not
create an IPLB (such as when -kernel is provided). In
this case, a misleading error message will be printed
stating that the "boot menu is not supported for this
device type".

To amend this, only print this message iff boot menu=on
was provided on the commandline. Otherwise, return silently.

While we're at it, remove trailing periods from error
messages.

Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com>
Message-Id: <1519760121-24594-1-git-send-email-walling@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
  • Loading branch information
Collin L. Walling authored and cohuck committed Mar 8, 2018
1 parent c575fa6 commit 5600086
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hw/s390x/ipl.c
Expand Up @@ -234,7 +234,7 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl)
if (!get_boot_device(0)) {
if (boot_menu) {
error_report("boot menu requires a bootindex to be specified for "
"the IPL device.");
"the IPL device");
}
return;
}
Expand All @@ -250,7 +250,9 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl)
case S390_IPL_TYPE_QEMU_SCSI:
break;
default:
error_report("boot menu is not supported for this device type.");
if (boot_menu) {
error_report("boot menu is not supported for this device type");
}
return;
}

Expand All @@ -263,13 +265,13 @@ static void s390_ipl_set_boot_menu(S390IPLState *ipl)
tmp = qemu_opt_get(opts, "splash-time");

if (tmp && qemu_strtoul(tmp, NULL, 10, &splash_time)) {
error_report("splash-time is invalid, forcing it to 0.");
error_report("splash-time is invalid, forcing it to 0");
*timeout = 0;
return;
}

if (splash_time > 0xffffffff) {
error_report("splash-time is too large, forcing it to max value.");
error_report("splash-time is too large, forcing it to max value");
*timeout = 0xffffffff;
return;
}
Expand Down

0 comments on commit 5600086

Please sign in to comment.