[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/9] hw/arm/virt: Improve CPU name in help message
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 5/9] hw/arm/virt: Improve CPU name in help message |
Date: |
Fri, 5 Feb 2021 15:58:39 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 2/5/21 3:43 PM, Philippe Mathieu-Daudé wrote:
> When selecting an incorrect CPU, there is a mismatch between the
> CPU name provided and the one displayed (which is some QEMU internal
> name):
>
> $ qemu-system-aarch64 -M virt -cpu cortex-a8
> qemu-system-aarch64: mach-virt: CPU type cortex-a8-arm-cpu not supported
>
> Strip the suffix to display the correct CPU name:
>
> $ qemu-system-aarch64 -M virt -cpu cortex-a8
> qemu-system-aarch64: mach-virt: CPU type cortex-a8-arm
Grrr wrong paste. Should be:
qemu-system-aarch64: mach-virt: CPU type cortex-a8 not supported
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/arm/virt.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 399da734548..7802d3a66e8 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1829,7 +1829,10 @@ static void machvirt_init(MachineState *machine)
> finalize_gic_version(vms);
>
> if (!cpu_type_valid(machine->cpu_type)) {
> - error_report("mach-virt: CPU type %s not supported",
> machine->cpu_type);
> + int len = strlen(machine->cpu_type) - strlen(ARM_CPU_TYPE_SUFFIX);
> +
> + error_report("mach-virt: CPU type %.*s not supported",
> + len, machine->cpu_type);
> exit(1);
> }
>
>
- [PATCH 4/9] tests/qtest/cdrom-test: Only allow the Virt machine under KVM, (continued)
- [PATCH 4/9] tests/qtest/cdrom-test: Only allow the Virt machine under KVM, Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 7/9] hw/arm/virt: Do not include 64-bit CPUs in 32-bit build, Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 6/9] hw/arm/virt: Display list of valid CPUs for the Virt machine, Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 5/9] hw/arm/virt: Improve CPU name in help message, Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 8/9] hw/arm/virt: Restrict 32-bit CPUs to TCG, Philippe Mathieu-Daudé, 2021/02/05
- [RFC PATCH 9/9] tests/qtest/arm-cpu-features: Restrict TCG-only tests, Philippe Mathieu-Daudé, 2021/02/05
- Re: [RFC PATCH 9/9] tests/qtest/arm-cpu-features: Restrict TCG-only tests, Andrew Jones, 2021/02/05
- Re: [PATCH 0/9] hw/arm/virt: Improve CPU help and fix testing under KVM, Philippe Mathieu-Daudé, 2021/02/05