qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] qom: Introduce object_realize_nofail()


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2] qom: Introduce object_realize_nofail()
Date: Thu, 12 Apr 2012 17:15:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Il 12/04/2012 15:58, Andreas Färber ha scritto:
> The big clash that Paolo and I had turned out to stem from tackling two
> virtually inconsolable goals, both under the banner of "realize":

I think the code was similar enough that the goals are not
unreconcilable (though QOM goals can certainly become sad if they aren't
achieved in a few years :).

> 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.

FWIW, I agree.

> 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.

Do you have examples?  As long as the objects are created in the realize
method itself you can do that.

> 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).

The child MemoryRegion could be created at realize time as long as the
composition tree hierarchy is correct.  A child's MR can use a MR
property that the parent creates at realize time, because the parent is
always realized first and unrealized last.

Some properties however might need to become dynamic, for example a
SOC's number_of_uarts property would create children before realization.

> i) Moving vcpu_init() from cpu_*_init() into a realizefn.

This is compatible with realize-once-at-machine-creation.

> ii) Instantiating an SoC container object with varying CPU.

This seems similar to the MemoryRegion case.

> iii) Moving ARM feature inference into a realizefn.

I don't know anything at all about this. :)

If you need it as a stopgap measure, you could have cpu_realize_nofail
in qom/cpu.h.  I wouldn't at all oppose to that.  But it shouldn't be
encouraged, IMO.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]