On 7 December 2017 at 17:13, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 7 December 2017 at 17:07, Eduardo Habkost <ehabk...@redhat.com> wrote: >> On Thu, Dec 07, 2017 at 04:53:59PM +0000, Peter Maydell wrote: >>> On 7 December 2017 at 16:48, Igor Mammedov <imamm...@redhat.com> wrote: >>> > On Thu, 7 Dec 2017 16:05:50 +0000 >>> > Peter Maydell <peter.mayd...@linaro.org> wrote: >>> > >>> >> Hi; I'm currently writing '-cpu max' support for ARM. For that I'd >>> >> like to be able to do the "probe host kernel for its supported feature >>> >> set" in the CPU object's instance-init function, but I'd like to do >> >> I don't think instance_init is appropriate for that, as >> object_free(object_new(t)) must be always safe to call and free >> of side-effects for all types. Wouldn't it work if you do that >> on realize? > > I think we need the information before realize, but I'll double > check.
We do need the information before realize, because the probe is what tells us what feature bits we need to set, and the ARM instance_post_init hook needs to look at those to determine eg which other feature bits to set and which QOM properties to expose as a result, and all that has to happen at init time, not realize time. thanks -- PMM