[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-7.1 1/4] target/loongarch: Only allow short -cpu argument
From: |
Igor Mammedov |
Subject: |
Re: [PATCH for-7.1 1/4] target/loongarch: Only allow short -cpu arguments without type name suffix |
Date: |
Mon, 15 Aug 2022 12:19:11 +0200 |
On Sun, 14 Aug 2022 22:55:19 +0800
WANG Xuerui <i.qemu@xen0n.name> wrote:
> From: WANG Xuerui <git@xen0n.name>
>
> Previously both "foo" and "foo-loongarch-cpu" are accepted for the -cpu
> command-line option, the latter of which being excessively long and
> redundant, hence unwanted. Remove support for consistency with other
> targets and simpler code.
to be consistent wit -device and other (qmp/monitor interfaces)
it's better to drop short variants (they are there mainly for compat
reasons) and use only long names (i.e. complete type name).
use avr_cpu_class_by_name() as an example
>
> Signed-off-by: WANG Xuerui <git@xen0n.name>
> ---
> target/loongarch/cpu.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
> index 941e2772bc..dc233ee209 100644
> --- a/target/loongarch/cpu.c
> +++ b/target/loongarch/cpu.c
> @@ -573,14 +573,11 @@ static ObjectClass *loongarch_cpu_class_by_name(const
> char *cpu_model)
> {
> ObjectClass *oc;
>
> - oc = object_class_by_name(cpu_model);
> + g_autofree char *typename =
> g_strdup_printf(LOONGARCH_CPU_TYPE_NAME("%s"),
> + cpu_model);
> + oc = object_class_by_name(typename);
> if (!oc) {
> - g_autofree char *typename
> - = g_strdup_printf(LOONGARCH_CPU_TYPE_NAME("%s"), cpu_model);
> - oc = object_class_by_name(typename);
> - if (!oc) {
> - return NULL;
> - }
> + return NULL;
> }
>
> if (object_class_dynamic_cast(oc, TYPE_LOONGARCH_CPU)
- Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", (continued)
- Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", chen huacai, 2022/08/16
- Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", gaosong, 2022/08/17
- Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", WANG Xuerui, 2022/08/17
- Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", Richard Henderson, 2022/08/17
- Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", WANG Xuerui, 2022/08/17
- Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", maobibo, 2022/08/18
- Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", Richard Henderson, 2022/08/18
Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00", maobibo, 2022/08/16
[PATCH for-7.1 1/4] target/loongarch: Only allow short -cpu arguments without type name suffix, WANG Xuerui, 2022/08/14
[PATCH for-7.1 2/4] target/loongarch: Trim type name suffix in -cpu help output, WANG Xuerui, 2022/08/14
[PATCH for-7.1 4/4] docs, target/loongarch: Rewrite the LoongArch docs, WANG Xuerui, 2022/08/14