From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VirjG-0006CL-2M for qemu-devel@nongnu.org; Tue, 19 Nov 2013 15:17:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VirjB-0006Sw-5u for qemu-devel@nongnu.org; Tue, 19 Nov 2013 15:16:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VirjA-0006Sl-Uy for qemu-devel@nongnu.org; Tue, 19 Nov 2013 15:16:53 -0500 Date: Tue, 19 Nov 2013 21:16:42 +0100 From: Igor Mammedov Message-ID: <20131119211642.107b84e8@thinkpad> In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] ARM cpu object, setting properties from board model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Andreas =?ISO-8859-1?B?RuRy?= =?ISO-8859-1?B?YmVy?= On Tue, 19 Nov 2013 20:01:28 +0000 Peter Maydell wrote: > I find myself with a use case where I would like to set > a CPU object property from the board model init function > (specifically, I'd like the board model to be able to say > "this CPU will boot via PSCI so if you're KVM then start > it appropriately"). > > I could just reach in and fiddle with the ARMCPU field > the way hw/arm/highback.c does with reset_cbar (and in fact > that's what I'm likely to do for the moment). However it > seems like it would be nicer for it to be an official > QOM property. This is alas not currently possible because > cpu_arm_init() does both 'init' and 'realize', and once > you've called it it's too late to set properties. It's possible to use global properties even with cpu_arm_init(), if it's registered for CPU type before cpu_arm_init() is called. Than that property would be applied to every new CPU instance by device_post_init() hook on before object_new() returns. > > Andreas -- did you have any thoughts/plans/code in this area? > Splitting the realize part out of cpu_arm_init(), or > providing a cpu_arm_init_dont_realize() [ugh], would be > easy to code but is it going in the right direction? > > thanks > -- PMM > -- Regards, Igor