Am 12.04.2012 16:47, schrieb Anthony Liguori: > On 04/12/2012 08:44 AM, Andreas Färber wrote: >> Wrap setting of Object::realized property, error reporting and exit(1) >> into a helper function. It is the equivalent of qdev_init_nofail(). > > I don't like this. > > If for no reason other than, a much more specific justification is > needed for this. I absolutely don't want to repeat the error handling > mistakes of qdev. I would rather we refactor all of the users of > qdev_init_nofail() to propagate errors.
I didn't get around to replying to your other mail yet: The big clash that Paolo and I had turned out to stem from tackling two virtually inconsolable goals, both under the banner of "realize": 1) Me and Peter need a way to do two-stage construction of non-qdev objects. Inlining the below code into lots of machine init functions is a really bad suggestion IMO. 2) Paolo is working towards the model envisioned by you where only a single realize call is made in vl.c and propagates to all children. I don't see 2) working at this stage due to the very simple fact that we create objects in the second stage depending on properties. The one-realize model is also incompatible with the static properties concept that Paolo is moving into object in this series - we'd need to make them dynamic properties that actually do something when set (e.g., modify the offset of a particular child MemoryRegion). So unless all devices are reworked to fit into the envisioned realize model, we will need some function like this. Current pressing use cases are: i) Moving vcpu_init() from cpu_*_init() into a realizefn. ii) Instantiating an SoC container object with varying CPU. iii) Moving ARM feature inference into a realizefn. Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg