From: Igor Mammedov <imammedo@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>,
Paolo Bonzini <pbonzini@redhat.com>,
Riku Voipio <riku.voipio@iki.fi>,
Like Xu <like.xu@linux.intel.com>,
Richard Henderson <rth@twiddle.net>,
David Gibson <david@gibson.dropbear.id.au>,
Thomas Huth <thuth@redhat.com>,
qemu-ppc@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Artyom Tarasenko <atar4qemu@gmail.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Subject: Re: [Qemu-devel] [PATCH 1/5] cpu: Rename parse_cpu_model() to parse_cpu_option()
Date: Thu, 18 Apr 2019 13:07:53 +0200 [thread overview]
Message-ID: <20190418130753.1dbf0b6b@redhat.com> (raw)
In-Reply-To: <20190417025944.16154-2-ehabkost@redhat.com>
On Tue, 16 Apr 2019 23:59:40 -0300
Eduardo Habkost <ehabkost@redhat.com> wrote:
> The "model[,option...]" string parsed by the function is not just
> a CPU model. Rename the function and its argument to indicate it
> expects the full "-cpu" option to be provided.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> include/qom/cpu.h | 6 +++---
> bsd-user/main.c | 2 +-
> exec.c | 4 ++--
> linux-user/main.c | 2 +-
> vl.c | 18 +++++++++---------
> 5 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index 1d6099e5d4..d28c690b27 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -689,15 +689,15 @@ ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model);
> CPUState *cpu_create(const char *typename);
>
> /**
> - * parse_cpu_model:
> - * @cpu_model: The model string including optional parameters.
> + * parse_cpu_option:
> + * @cpu_option: The -cpu option including optional parameters.
> *
> * processes optional parameters and registers them as global properties
> *
> * Returns: type of CPU to create or prints error and terminates process
> * if an error occurred.
> */
> -const char *parse_cpu_model(const char *cpu_model);
> +const char *parse_cpu_option(const char *cpu_option);
>
> /**
> * cpu_has_work:
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index 0d3156974c..a6c055f5fb 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -903,7 +903,7 @@ int main(int argc, char **argv)
> /* init tcg before creating CPUs and to get qemu_host_page_size */
> tcg_exec_init(0);
>
> - cpu_type = parse_cpu_model(cpu_model);
> + cpu_type = parse_cpu_option(cpu_model);
> cpu = cpu_create(cpu_type);
> env = cpu->env_ptr;
> #if defined(TARGET_SPARC) || defined(TARGET_PPC)
> diff --git a/exec.c b/exec.c
> index 6ab62f4eee..840677f15f 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -982,14 +982,14 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
> #endif
> }
>
> -const char *parse_cpu_model(const char *cpu_model)
> +const char *parse_cpu_option(const char *cpu_option)
> {
> ObjectClass *oc;
> CPUClass *cc;
> gchar **model_pieces;
> const char *cpu_type;
>
> - model_pieces = g_strsplit(cpu_model, ",", 2);
> + model_pieces = g_strsplit(cpu_option, ",", 2);
>
> oc = cpu_class_by_name(CPU_RESOLVING_TYPE, model_pieces[0]);
> if (oc == NULL) {
> diff --git a/linux-user/main.c b/linux-user/main.c
> index a0aba9cb1e..20e0f51cfa 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -660,7 +660,7 @@ int main(int argc, char **argv, char **envp)
> if (cpu_model == NULL) {
> cpu_model = cpu_get_model(get_elf_eflags(execfd));
> }
> - cpu_type = parse_cpu_model(cpu_model);
> + cpu_type = parse_cpu_option(cpu_model);
>
> /* init tcg before creating CPUs and to get qemu_host_page_size */
> tcg_exec_init(0);
> diff --git a/vl.c b/vl.c
> index c696ad2a13..c57e28d1da 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3002,7 +3002,7 @@ int main(int argc, char **argv, char **envp)
> const char *optarg;
> const char *loadvm = NULL;
> MachineClass *machine_class;
> - const char *cpu_model;
> + const char *cpu_option;
> const char *vga_model = NULL;
> const char *qtest_chrdev = NULL;
> const char *qtest_log = NULL;
> @@ -3081,7 +3081,7 @@ int main(int argc, char **argv, char **envp)
> QLIST_INIT (&vm_change_state_head);
> os_setup_early_signal_handling();
>
> - cpu_model = NULL;
> + cpu_option = NULL;
> snapshot = 0;
>
> nb_nics = 0;
> @@ -3133,7 +3133,7 @@ int main(int argc, char **argv, char **envp)
> switch(popt->index) {
> case QEMU_OPTION_cpu:
> /* hw initialization will check this */
> - cpu_model = optarg;
> + cpu_option = optarg;
> break;
> case QEMU_OPTION_hda:
> case QEMU_OPTION_hdb:
> @@ -4050,8 +4050,8 @@ int main(int argc, char **argv, char **envp)
> qemu_set_hw_version(machine_class->hw_version);
> }
>
> - if (cpu_model && is_help_option(cpu_model)) {
> - list_cpus(stdout, &fprintf, cpu_model);
> + if (cpu_option && is_help_option(cpu_option)) {
> + list_cpus(stdout, &fprintf, cpu_option);
> exit(0);
> }
>
> @@ -4299,9 +4299,9 @@ int main(int argc, char **argv, char **envp)
> * Global properties get set up by qdev_prop_register_global(),
> * called from user_register_global_props(), and certain option
> * desugaring. Also in CPU feature desugaring (buried in
> - * parse_cpu_model()), which happens below this point, but may
> + * parse_cpu_option()), which happens below this point, but may
> * only target the CPU type, which can only be created after
> - * parse_cpu_model() returned the type.
> + * parse_cpu_option() returned the type.
> *
> * Machine compat properties: object_set_machine_compat_props().
> * Accelerator compat props: object_set_accelerator_compat_props(),
> @@ -4465,8 +4465,8 @@ int main(int argc, char **argv, char **envp)
>
> /* parse features once if machine provides default cpu_type */
> current_machine->cpu_type = machine_class->default_cpu_type;
> - if (cpu_model) {
> - current_machine->cpu_type = parse_cpu_model(cpu_model);
> + if (cpu_option) {
> + current_machine->cpu_type = parse_cpu_option(cpu_option);
> }
> parse_numa_opts(current_machine);
>
WARNING: multiple messages have this Message-ID (diff)
From: Igor Mammedov <imammedo@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>,
Markus Armbruster <armbru@redhat.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>,
David Gibson <david@gibson.dropbear.id.au>,
Artyom Tarasenko <atar4qemu@gmail.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 1/5] cpu: Rename parse_cpu_model() to parse_cpu_option()
Date: Thu, 18 Apr 2019 13:07:53 +0200 [thread overview]
Message-ID: <20190418130753.1dbf0b6b@redhat.com> (raw)
Message-ID: <20190418110753.BUWIST7fPQGurfEM9u_WZfTU3GlANNNiv9crdpDShY8@z> (raw)
In-Reply-To: <20190417025944.16154-2-ehabkost@redhat.com>
On Tue, 16 Apr 2019 23:59:40 -0300
Eduardo Habkost <ehabkost@redhat.com> wrote:
> The "model[,option...]" string parsed by the function is not just
> a CPU model. Rename the function and its argument to indicate it
> expects the full "-cpu" option to be provided.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> include/qom/cpu.h | 6 +++---
> bsd-user/main.c | 2 +-
> exec.c | 4 ++--
> linux-user/main.c | 2 +-
> vl.c | 18 +++++++++---------
> 5 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index 1d6099e5d4..d28c690b27 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -689,15 +689,15 @@ ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model);
> CPUState *cpu_create(const char *typename);
>
> /**
> - * parse_cpu_model:
> - * @cpu_model: The model string including optional parameters.
> + * parse_cpu_option:
> + * @cpu_option: The -cpu option including optional parameters.
> *
> * processes optional parameters and registers them as global properties
> *
> * Returns: type of CPU to create or prints error and terminates process
> * if an error occurred.
> */
> -const char *parse_cpu_model(const char *cpu_model);
> +const char *parse_cpu_option(const char *cpu_option);
>
> /**
> * cpu_has_work:
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index 0d3156974c..a6c055f5fb 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -903,7 +903,7 @@ int main(int argc, char **argv)
> /* init tcg before creating CPUs and to get qemu_host_page_size */
> tcg_exec_init(0);
>
> - cpu_type = parse_cpu_model(cpu_model);
> + cpu_type = parse_cpu_option(cpu_model);
> cpu = cpu_create(cpu_type);
> env = cpu->env_ptr;
> #if defined(TARGET_SPARC) || defined(TARGET_PPC)
> diff --git a/exec.c b/exec.c
> index 6ab62f4eee..840677f15f 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -982,14 +982,14 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
> #endif
> }
>
> -const char *parse_cpu_model(const char *cpu_model)
> +const char *parse_cpu_option(const char *cpu_option)
> {
> ObjectClass *oc;
> CPUClass *cc;
> gchar **model_pieces;
> const char *cpu_type;
>
> - model_pieces = g_strsplit(cpu_model, ",", 2);
> + model_pieces = g_strsplit(cpu_option, ",", 2);
>
> oc = cpu_class_by_name(CPU_RESOLVING_TYPE, model_pieces[0]);
> if (oc == NULL) {
> diff --git a/linux-user/main.c b/linux-user/main.c
> index a0aba9cb1e..20e0f51cfa 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -660,7 +660,7 @@ int main(int argc, char **argv, char **envp)
> if (cpu_model == NULL) {
> cpu_model = cpu_get_model(get_elf_eflags(execfd));
> }
> - cpu_type = parse_cpu_model(cpu_model);
> + cpu_type = parse_cpu_option(cpu_model);
>
> /* init tcg before creating CPUs and to get qemu_host_page_size */
> tcg_exec_init(0);
> diff --git a/vl.c b/vl.c
> index c696ad2a13..c57e28d1da 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3002,7 +3002,7 @@ int main(int argc, char **argv, char **envp)
> const char *optarg;
> const char *loadvm = NULL;
> MachineClass *machine_class;
> - const char *cpu_model;
> + const char *cpu_option;
> const char *vga_model = NULL;
> const char *qtest_chrdev = NULL;
> const char *qtest_log = NULL;
> @@ -3081,7 +3081,7 @@ int main(int argc, char **argv, char **envp)
> QLIST_INIT (&vm_change_state_head);
> os_setup_early_signal_handling();
>
> - cpu_model = NULL;
> + cpu_option = NULL;
> snapshot = 0;
>
> nb_nics = 0;
> @@ -3133,7 +3133,7 @@ int main(int argc, char **argv, char **envp)
> switch(popt->index) {
> case QEMU_OPTION_cpu:
> /* hw initialization will check this */
> - cpu_model = optarg;
> + cpu_option = optarg;
> break;
> case QEMU_OPTION_hda:
> case QEMU_OPTION_hdb:
> @@ -4050,8 +4050,8 @@ int main(int argc, char **argv, char **envp)
> qemu_set_hw_version(machine_class->hw_version);
> }
>
> - if (cpu_model && is_help_option(cpu_model)) {
> - list_cpus(stdout, &fprintf, cpu_model);
> + if (cpu_option && is_help_option(cpu_option)) {
> + list_cpus(stdout, &fprintf, cpu_option);
> exit(0);
> }
>
> @@ -4299,9 +4299,9 @@ int main(int argc, char **argv, char **envp)
> * Global properties get set up by qdev_prop_register_global(),
> * called from user_register_global_props(), and certain option
> * desugaring. Also in CPU feature desugaring (buried in
> - * parse_cpu_model()), which happens below this point, but may
> + * parse_cpu_option()), which happens below this point, but may
> * only target the CPU type, which can only be created after
> - * parse_cpu_model() returned the type.
> + * parse_cpu_option() returned the type.
> *
> * Machine compat properties: object_set_machine_compat_props().
> * Accelerator compat props: object_set_accelerator_compat_props(),
> @@ -4465,8 +4465,8 @@ int main(int argc, char **argv, char **envp)
>
> /* parse features once if machine provides default cpu_type */
> current_machine->cpu_type = machine_class->default_cpu_type;
> - if (cpu_model) {
> - current_machine->cpu_type = parse_cpu_model(cpu_model);
> + if (cpu_option) {
> + current_machine->cpu_type = parse_cpu_option(cpu_option);
> }
> parse_numa_opts(current_machine);
>
next prev parent reply other threads:[~2019-04-18 11:17 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 [this message]
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
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=20190418130753.1dbf0b6b@redhat.com \
--to=imammedo@redhat.com \
--cc=armbru@redhat.com \
--cc=atar4qemu@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=ehabkost@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.