Skip to contentSkip to conversation

s390/ipl: only print boot menu error if -boot menu=on was specified

PATCH Applied Collin L. Walling 4 participants 4 messages Feb 27, 2018 – Mar 2, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 s390/ipl: only print boot menu error if -boot menu=on was specified

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.

---
 hw/s390x/ipl.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
hw/s390x/ipl.c +6 -4
index 798e99a..d7fb33f 100644
@@ -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;
     }
@@ -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;
     }
 
@@ -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;
     }
Signature · 1 line
2.7.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Collin L. Walling

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.

Quoted 7 lines

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

---
 hw/s390x/ipl.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Acked-by on v2 1/1
#2 lore raw
In reply to Collin L. Walling
Quoted 6 lines · Collin L. Walling

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".

Quoted 7 lines

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.

This also Fixes qemu iotest 200.

Quoted 45 lines
---
 hw/s390x/ipl.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
hw/s390x/ipl.c +6 -4
index 798e99a..d7fb33f 100644
@@ -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;
     }
@@ -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;
     }
 
@@ -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;
     }
#3 lore raw
In reply to Collin L. Walling
Quoted 9 lines · On Tue, 27 Feb 2018 14:35:21 -0500 "Collin L. Walling"…

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.

Quoted 7 lines

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

---
 hw/s390x/ipl.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Thanks, applied.