All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	Thomas Huth <thuth@redhat.com>, Like Xu <like.xu@linux.intel.com>,
	Riku Voipio <riku.voipio@iki.fi>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Laurent Vivier <laurent@vivier.eu>,
	qemu-ppc@nongnu.org, Igor Mammedov <imammedo@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Artyom Tarasenko <atar4qemu@gmail.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 2/5] cpu: Extract CPU class lookup from parse_cpu_option()
Date: Wed, 17 Apr 2019 07:41:23 +0200	[thread overview]
Message-ID: <871s21194s.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20190417025944.16154-3-ehabkost@redhat.com> (Eduardo Habkost's message of "Tue, 16 Apr 2019 23:59:41 -0300")

Eduardo Habkost <ehabkost@redhat.com> writes:

> The new function will be useful in user mode, when we already
> have a CPU model and don't need to parse any extra options.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  include/qom/cpu.h |  9 +++++++++
>  exec.c            | 22 ++++++++++++----------
>  2 files changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index d28c690b27..e11b14d9ac 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -699,6 +699,15 @@ CPUState *cpu_create(const char *typename);
>   */
>  const char *parse_cpu_option(const char *cpu_option);
>  
> +/**
> + * lookup_cpu_class:
> + * @cpu_model: CPU model name
> + *
> + * Look up CPU class corresponding to a given CPU model name.
> + */
> +CPUClass *lookup_cpu_class(const char *cpu_model, Error **errp);

Nitpicks, feel free to ignore.

Naming: lookup_cpu_class() makes my reading circuits stall momentarily,
because lookup is a noun. The verb is spelled look up.  No stall:
cpu_class_lookup(), look_up_cpu_class(), cpu_class_by_name_err(),
cpu_class_parse(), ...

Doc string: this is a wrapper around cpu_class_by_name().  Perhaps that
should be spelled out.

Apropos cpu_class_by_name(): it returns ObjectClass, not CPUClass.
Isn't that odd?

Position: If you put it before cpu_create() rather than after, it's next
to the function it wraps.  But perhaps you prefer to keep it next to
parse_cpu_option().

[...]

WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Thomas Huth <thuth@redhat.com>, Like Xu <like.xu@linux.intel.com>,
	Riku Voipio <riku.voipio@iki.fi>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>,
	qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Artyom Tarasenko <atar4qemu@gmail.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH 2/5] cpu: Extract CPU class lookup from parse_cpu_option()
Date: Wed, 17 Apr 2019 07:41:23 +0200	[thread overview]
Message-ID: <871s21194s.fsf@dusky.pond.sub.org> (raw)
Message-ID: <20190417054123.uqoTCoUkgdWbU6rPv8FzbmfBZfqGvXLaWcUl-bohPMc@z> (raw)
In-Reply-To: <20190417025944.16154-3-ehabkost@redhat.com> (Eduardo Habkost's message of "Tue, 16 Apr 2019 23:59:41 -0300")

Eduardo Habkost <ehabkost@redhat.com> writes:

> The new function will be useful in user mode, when we already
> have a CPU model and don't need to parse any extra options.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  include/qom/cpu.h |  9 +++++++++
>  exec.c            | 22 ++++++++++++----------
>  2 files changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index d28c690b27..e11b14d9ac 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -699,6 +699,15 @@ CPUState *cpu_create(const char *typename);
>   */
>  const char *parse_cpu_option(const char *cpu_option);
>  
> +/**
> + * lookup_cpu_class:
> + * @cpu_model: CPU model name
> + *
> + * Look up CPU class corresponding to a given CPU model name.
> + */
> +CPUClass *lookup_cpu_class(const char *cpu_model, Error **errp);

Nitpicks, feel free to ignore.

Naming: lookup_cpu_class() makes my reading circuits stall momentarily,
because lookup is a noun. The verb is spelled look up.  No stall:
cpu_class_lookup(), look_up_cpu_class(), cpu_class_by_name_err(),
cpu_class_parse(), ...

Doc string: this is a wrapper around cpu_class_by_name().  Perhaps that
should be spelled out.

Apropos cpu_class_by_name(): it returns ObjectClass, not CPUClass.
Isn't that odd?

Position: If you put it before cpu_create() rather than after, it's next
to the function it wraps.  But perhaps you prefer to keep it next to
parse_cpu_option().

[...]


  parent reply	other threads:[~2019-04-17  5:41 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17  2:59 [Qemu-devel] [PATCH 0/5] Remove qdev_get_machine() call from ppc_cpu_parse_featurestr() Eduardo Habkost
2019-04-17  2:59 ` Eduardo Habkost
2019-04-17  2:59 ` [Qemu-devel] [PATCH 1/5] cpu: Rename parse_cpu_model() to parse_cpu_option() Eduardo Habkost
2019-04-17  2:59   ` Eduardo Habkost
2019-04-17  5:21   ` David Gibson
2019-04-17  5:21     ` David Gibson
2019-04-18 11:07   ` Igor Mammedov
2019-04-18 11:07     ` Igor Mammedov
2019-04-17  2:59 ` [Qemu-devel] [PATCH 2/5] cpu: Extract CPU class lookup from parse_cpu_option() Eduardo Habkost
2019-04-17  2:59   ` Eduardo Habkost
2019-04-17  5:22   ` David Gibson
2019-04-17  5:22     ` David Gibson
2019-04-17  5:41   ` Markus Armbruster [this message]
2019-04-17  5:41     ` Markus Armbruster
2019-04-17 13:55     ` Eduardo Habkost
2019-04-17 13:55       ` Eduardo Habkost
2019-04-17  2:59 ` [Qemu-devel] [PATCH 3/5] linux-user: Use lookup_cpu_class() Eduardo Habkost
2019-04-17  2:59   ` Eduardo Habkost
2019-04-17  5:23   ` David Gibson
2019-04-17  5:23     ` David Gibson
2019-04-18  4:52   ` Eduardo Habkost
2019-04-18  4:52     ` Eduardo Habkost
2019-04-17  2:59 ` [Qemu-devel] [PATCH 4/5] bsd-user: " Eduardo Habkost
2019-04-17  2:59   ` Eduardo Habkost
2019-04-17  5:23   ` David Gibson
2019-04-17  5:23     ` David Gibson
2019-04-17  2:59 ` [Qemu-devel] [PATCH 5/5] cpu: Add MachineState parameter to parse_features() Eduardo Habkost
2019-04-17  2:59   ` Eduardo Habkost
2019-04-17  5:25   ` David Gibson
2019-04-17  5:25     ` David Gibson
2019-04-17  5:45   ` Markus Armbruster
2019-04-17  5:45     ` Markus Armbruster
2019-04-17  5:45 ` [Qemu-devel] [PATCH 0/5] Remove qdev_get_machine() call from ppc_cpu_parse_featurestr() Markus Armbruster
2019-04-17  5:45   ` Markus Armbruster
2019-04-18  3:35   ` Eduardo Habkost
2019-04-18  3:35     ` Eduardo Habkost

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=871s21194s.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=atar4qemu@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=like.xu@linux.intel.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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.