Skip to contentSkip to conversation

hw/arm/virt: Update error message for bad gic-version option

PATCH In review Peter Maydell 4 participants 4 messages Feb 19 – Feb 20

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/virt: Update error message for bad gic-version option

As we added different valid gic-version option settings, we forgot to update the hint in the error message produced when the user specifies an invalid value:

$ qemu-system-aarch64 -M virt,help | grep gic-version
  gic-version=<string>   - Set GIC version. Valid values are 2, 3, 4, host and max
$ qemu-system-aarch64 -M virt,gic-version=bang
qemu-system-aarch64: Invalid gic-version value
Valid values are 3, 2, host, max.

Update the error string to match the one we use in the help text for the option.

---
 hw/arm/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/virt.c +1 -1
index 50865e8115..8dc999712c 100644
@@ -2971,7 +2971,7 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp)
         vms->gic_version = VIRT_GIC_VERSION_MAX; /* Will probe later */
     } else {
         error_setg(errp, "Invalid gic-version value");
-        error_append_hint(errp, "Valid values are 3, 2, host, max.\n");
+        error_append_hint(errp, "Valid values are 2, 3, 4, host, and max.\n");
     }
 }
 
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Peter Maydell

As we added different valid gic-version option settings, we forgot to update the hint in the error message produced when the user specifies an invalid value:

$ qemu-system-aarch64 -M virt,help | grep gic-version
 gic-version=<string>   - Set GIC version. Valid values are 2, 3, 4, host and max
$ qemu-system-aarch64 -M virt,gic-version=bang
qemu-system-aarch64: Invalid gic-version value
Valid values are 3, 2, host, max.
Quoted 4 lines

Update the error string to match the one we use in the help text for the option.

Quoted 21 lines

---
hw/arm/virt.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/virt.c +1 -1
index 50865e8115..8dc999712c 100644
@@ -2971,7 +2971,7 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp)
        vms->gic_version = VIRT_GIC_VERSION_MAX; /* Will probe later */
    } else {
        error_setg(errp, "Invalid gic-version value");
-        error_append_hint(errp, "Valid values are 3, 2, host, max.\n");
+        error_append_hint(errp, "Valid values are 2, 3, 4, host, and max.\n");
    }
 }
 
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Maydell
Quoted 10 lines · Peter Maydell

As we added different valid gic-version option settings, we forgot to update the hint in the error message produced when the user specifies an invalid value:

$ qemu-system-aarch64 -M virt,help | grep gic-version
   gic-version=<string>   - Set GIC version. Valid values are 2, 3, 4, host and max
$ qemu-system-aarch64 -M virt,gic-version=bang
qemu-system-aarch64: Invalid gic-version value
Valid values are 3, 2, host, max.
Quoted 7 lines

Update the error string to match the one we use in the help text for the option.

---
  hw/arm/virt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 1/1
#3 lore raw
In reply to Peter Maydell
Quoted 10 lines · Peter Maydell

As we added different valid gic-version option settings, we forgot to update the hint in the error message produced when the user specifies an invalid value:

$ qemu-system-aarch64 -M virt,help | grep gic-version
  gic-version=<string>   - Set GIC version. Valid values are 2, 3, 4, host and max
$ qemu-system-aarch64 -M virt,gic-version=bang
qemu-system-aarch64: Invalid gic-version value
Valid values are 3, 2, host, max.
Quoted 4 lines

Update the error string to match the one we use in the help text for the option.

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro