From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXCFw-00024i-T9 for qemu-devel@nongnu.org; Tue, 30 Apr 2013 11:14:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXCFs-0001w0-26 for qemu-devel@nongnu.org; Tue, 30 Apr 2013 11:14:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXCFr-0001uN-PE for qemu-devel@nongnu.org; Tue, 30 Apr 2013 11:14:07 -0400 Date: Tue, 30 Apr 2013 17:14:00 +0200 From: Igor Mammedov Message-ID: <20130430171400.76a130c9@nial.usersys.redhat.com> In-Reply-To: References: <1367329288-27178-1-git-send-email-imammedo@redhat.com> <1367329288-27178-4-git-send-email-imammedo@redhat.com> <20130430143043.GE28606@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/5] add cpu_model to QEMUMachine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: aliguori@us.ibm.com, Eduardo Habkost , qemu-devel@nongnu.org, anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de On Tue, 30 Apr 2013 15:54:34 +0100 Peter Maydell wrote: > On 30 April 2013 15:30, Eduardo Habkost wrote: > > My concern is that we already have a QEMUMachineInitArgs.cpu_model > > field, and now QEMUMachine.cpu_model and QEMUMachineInitArgs.cpu_model > > are redundant. > > > > To make it worse, both variables can disagree with each other because we > > have other code that set QEMUMachineInitArgs.cpu_model outside of > > main(): > > > > hw/arm/realview.c:338: args->cpu_model = "arm926"; > > hw/arm/realview.c:346: args->cpu_model = "arm11mpcore"; > > hw/arm/realview.c:354: args->cpu_model = "cortex-a8"; > > hw/arm/realview.c:362: args->cpu_model = "cortex-a9"; > > hw/arm/versatilepb.c:189: args->cpu_model = "arm926"; > > > > ARM doesn't have CPU hotplug, but this is still a bug waiting to happen. > > This ARM code is just borrowing the cpu_model field as a convenient > place to stash the default value for the board. There are other > ARM boards which do a similar thing but in a purely local variable > (eg vexpress)... yes, patch addresses Eduardo's concern about not setting cpu_model of machine args anywhere else except of main. And later we could cleanup machine args usage and default cpu_models for all targets. > > I think really if you want to know what the current CPU model > is you need to fish the relevant QOM qbject out from somewhere > at runtime. Ideally that QOM object would be QOMifyed QEMUMachine, but we are not there yet. > > -- PMM >