[PATCH 55/65] hw/arm/virt: Update error message for bad gic-version option

Peter Maydell posted 65 patches 1 month, 2 weeks ago
Maintainers: Peter Maydell <peter.maydell@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
There is a newer version of this series
[PATCH 55/65] hw/arm/virt: Update error message for bad gic-version option
Posted by Peter Maydell 1 month, 2 weeks ago
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.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 50865e8115..8dc999712c 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -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");
     }
 }
 
-- 
2.43.0


Re: [PATCH 55/65] hw/arm/virt: Update error message for bad gic-version option
Posted by Jonathan Cameron via qemu development 1 month ago
On Mon, 23 Feb 2026 17:02:02 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> 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.
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Ah. I was going to say what is is this doing in here? But I see
you already sent a pull request with this in it.

All good but for anyone else reading you can skip this one :)

J
Re: [PATCH 55/65] hw/arm/virt: Update error message for bad gic-version option
Posted by Peter Maydell 1 month ago
On Wed, 11 Mar 2026 at 17:55, Jonathan Cameron
<jonathan.cameron@huawei.com> wrote:
>
> On Mon, 23 Feb 2026 17:02:02 +0000
> Peter Maydell <peter.maydell@linaro.org> wrote:
>
> > 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.
> >
> > Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> Ah. I was going to say what is is this doing in here? But I see
> you already sent a pull request with this in it.
>
> All good but for anyone else reading you can skip this one :)

Yeah, it's only in here to avoid a conflict with the next patches
that also adjust this string.

-- PMM