From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXidn-0001QU-9m for qemu-devel@nongnu.org; Mon, 22 Feb 2016 00:02:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXidj-0004km-SM for qemu-devel@nongnu.org; Mon, 22 Feb 2016 00:02:35 -0500 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:50006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXidj-0004kE-A7 for qemu-devel@nongnu.org; Mon, 22 Feb 2016 00:02:31 -0500 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Feb 2016 15:02:28 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id D79832BB0055 for ; Mon, 22 Feb 2016 16:02:24 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1M52GBC49086602 for ; Mon, 22 Feb 2016 16:02:24 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1M51pIe014403 for ; Mon, 22 Feb 2016 16:01:52 +1100 From: Bharata B Rao Date: Mon, 22 Feb 2016 10:31:18 +0530 Message-Id: <1456117285-22273-2-git-send-email-bharata@linux.vnet.ibm.com> In-Reply-To: <1456117285-22273-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1456117285-22273-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v0 1/8] cpu: Store CPU typename in MachineState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ehabkost@redhat.com, aik@ozlabs.ru, Bharata B Rao , agraf@suse.de, armbru@redhat.com, pbonzini@redhat.com, imammedo@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au Storing CPU typename in MachineState lets us to create CPU threads for all architectures in uniform manner from arch-neutral code. TODO: Touching only sPAPR target for now Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 2 ++ include/hw/boards.h | 1 + 2 files changed, 3 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5bd8fd3..3892a99 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1823,6 +1823,8 @@ static void ppc_spapr_init(MachineState *machine) if (machine->cpu_model == NULL) { machine->cpu_model = kvm_enabled() ? "host" : "POWER7"; } + machine->cpu_type = TYPE_POWERPC_CPU; + for (i = 0; i < smp_cpus; i++) { cpu = cpu_ppc_init(machine->cpu_model); if (cpu == NULL) { diff --git a/include/hw/boards.h b/include/hw/boards.h index 0f30959..cf95d10 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -137,6 +137,7 @@ struct MachineState { char *kernel_cmdline; char *initrd_filename; const char *cpu_model; + const char *cpu_type; AccelState *accelerator; }; -- 2.1.0