All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: WANG Xuerui <i.qemu@xen0n.name>
Cc: qemu-devel@nongnu.org,
	Richard Henderson <richard.henderson@linaro.org>,
	Song Gao <gaosong@loongson.cn>,
	Xiaojuan Yang <yangxiaojuan@loongson.cn>,
	WANG Xuerui <git@xen0n.name>
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	[thread overview]
Message-ID: <20220815121911.572b5d65@redhat.com> (raw)
In-Reply-To: <20220814145522.1474927-2-i.qemu@xen0n.name>

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)



  parent reply	other threads:[~2022-08-15 10:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-14 14:53 [PATCH for-7.1 0/4] Last-minute LoongArch CPU model naming tweaks WANG Xuerui
2022-08-14 14:55 ` [PATCH for-7.1 1/4] target/loongarch: Only allow short -cpu arguments without type name suffix WANG Xuerui
2022-08-14 20:44   ` Richard Henderson
2022-08-15 10:19   ` Igor Mammedov [this message]
2022-08-14 14:55 ` [PATCH for-7.1 2/4] target/loongarch: Trim type name suffix in -cpu help output WANG Xuerui
2022-08-14 20:45   ` Richard Henderson
2022-08-14 14:55 ` [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00" WANG Xuerui
2022-08-14 20:53   ` Richard Henderson
2022-08-17  2:36     ` chen huacai
2022-08-17  8:11       ` gaosong
2022-08-17  9:10         ` WANG Xuerui
2022-08-17 13:26           ` Richard Henderson
2022-08-18  2:31             ` WANG Xuerui
2022-08-18  5:22               ` maobibo
2022-08-18 15:52               ` Richard Henderson
2022-08-17  3:52   ` maobibo
2022-08-14 14:55 ` [PATCH for-7.1 4/4] docs, target/loongarch: Rewrite the LoongArch docs WANG Xuerui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220815121911.572b5d65@redhat.com \
    --to=imammedo@redhat.com \
    --cc=gaosong@loongson.cn \
    --cc=git@xen0n.name \
    --cc=i.qemu@xen0n.name \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=yangxiaojuan@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.