From nobody Mon Feb 9 04:45:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555654747; cv=none; d=zoho.com; s=zohoarc; b=O3JJH1ZpjyyBBLUSX6HkYoUA9kMufuBTjK2DeZn9RO5SGrEI4Q9woTAd43TN6GOsECUNC/wHPyGCmwX+1TznGF9jYMLHVCali3pZeSw8hYX+Yo/sqgYfkx7vqOrrNKsbT4JYENZp9IBNOG0DiPcBV8ZvBDgXNUDkjTRcOhgtYfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555654747; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=KXb3Q0AX4XXFyvwYUqV7l05AWEL3YFY6vucK1/jZQYM=; b=LBzEpsyt8rfRQK1WgdJCEpLotedPVvvw4MP5hZrScYdj6rpVas83D0p71xZlFCfAlIq6VRPWt4gnbsbc7NbVXVk4RMu1kiFiJTJGC7+vN2afLVZjllNd/30kA+pd5MLVIRUgMhi2sxpSCc7iMAiLl+irrnxrDV7fS17ZnqGC6iE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1555654747886916.5223322188999; Thu, 18 Apr 2019 23:19:07 -0700 (PDT) Received: from localhost ([127.0.0.1]:51889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHMra-0000Nu-NW for importer@patchew.org; Fri, 19 Apr 2019 02:19:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHMnD-0005eF-GG for qemu-devel@nongnu.org; Fri, 19 Apr 2019 02:14:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHMnC-000509-94 for qemu-devel@nongnu.org; Fri, 19 Apr 2019 02:14:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34616) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hHMnC-0004zn-1j for qemu-devel@nongnu.org; Fri, 19 Apr 2019 02:14:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53D1A3082B69; Fri, 19 Apr 2019 06:14:33 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC4715C21F; Fri, 19 Apr 2019 06:14:32 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 19 Apr 2019 03:13:38 -0300 Message-Id: <20190419061349.17094-7-ehabkost@redhat.com> In-Reply-To: <20190419061349.17094-1-ehabkost@redhat.com> References: <20190419061349.17094-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 19 Apr 2019 06:14:33 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 06/17] cpu: Rename parse_cpu_model() to parse_cpu_option() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mammedov , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Message-Id: <20190417025944.16154-2-ehabkost@redhat.com> Reviewed-by: David Gibson Reviewed-by: Markus Armbruster Reviewed-by: Igor Mammedov Signed-off-by: Eduardo Habkost --- 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); =20 /** - * 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); =20 /** * 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); =20 - cpu_type =3D parse_cpu_model(cpu_model); + cpu_type =3D parse_cpu_option(cpu_model); cpu =3D cpu_create(cpu_type); env =3D 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 } =20 -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; =20 - model_pieces =3D g_strsplit(cpu_model, ",", 2); + model_pieces =3D g_strsplit(cpu_option, ",", 2); =20 oc =3D cpu_class_by_name(CPU_RESOLVING_TYPE, model_pieces[0]); if (oc =3D=3D 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 =3D=3D NULL) { cpu_model =3D cpu_get_model(get_elf_eflags(execfd)); } - cpu_type =3D parse_cpu_model(cpu_model); + cpu_type =3D parse_cpu_option(cpu_model); =20 /* 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 d88638c54c..34cdb8cece 100644 --- a/vl.c +++ b/vl.c @@ -2989,7 +2989,7 @@ int main(int argc, char **argv, char **envp) const char *optarg; const char *loadvm =3D NULL; MachineClass *machine_class; - const char *cpu_model; + const char *cpu_option; const char *vga_model =3D NULL; const char *qtest_chrdev =3D NULL; const char *qtest_log =3D NULL; @@ -3068,7 +3068,7 @@ int main(int argc, char **argv, char **envp) QLIST_INIT (&vm_change_state_head); os_setup_early_signal_handling(); =20 - cpu_model =3D NULL; + cpu_option =3D NULL; snapshot =3D 0; =20 nb_nics =3D 0; @@ -3120,7 +3120,7 @@ int main(int argc, char **argv, char **envp) switch(popt->index) { case QEMU_OPTION_cpu: /* hw initialization will check this */ - cpu_model =3D optarg; + cpu_option =3D optarg; break; case QEMU_OPTION_hda: case QEMU_OPTION_hdb: @@ -4037,8 +4037,8 @@ int main(int argc, char **argv, char **envp) qemu_set_hw_version(machine_class->hw_version); } =20 - 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); } =20 @@ -4286,9 +4286,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(), @@ -4452,8 +4452,8 @@ int main(int argc, char **argv, char **envp) =20 /* parse features once if machine provides default cpu_type */ current_machine->cpu_type =3D machine_class->default_cpu_type; - if (cpu_model) { - current_machine->cpu_type =3D parse_cpu_model(cpu_model); + if (cpu_option) { + current_machine->cpu_type =3D parse_cpu_option(cpu_option); } parse_numa_opts(current_machine); =20 --=20 2.18.0.rc1.1.g3f1ff2140