[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/9] hw/arm/virt: Improve CPU name in help message
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 5/9] hw/arm/virt: Improve CPU name in help message |
Date: |
Fri, 5 Feb 2021 15:43:41 +0100 |
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
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);
}
--
2.26.2
- [PATCH 2/9] tests/qtest: Restrict xlnx-can-test to TCG builds, (continued)
- [PATCH 2/9] tests/qtest: Restrict xlnx-can-test to TCG builds, Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 3/9] tests/qtest/boot-serial-test: Test Virt machine with 'max', Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 4/9] tests/qtest/cdrom-test: Only allow the Virt machine under KVM, Philippe Mathieu-Daudé, 2021/02/05
- [PATCH 5/9] hw/arm/virt: Improve CPU name in help message,
Philippe Mathieu-Daudé <=
- [PATCH 6/9] hw/arm/virt: Display list of valid CPUs for the Virt machine, 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 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