Cédric Le Goater <c...@kaod.org> writes:

> On 5/18/20 7:03 AM, Markus Armbruster wrote:
>> The number of stacks is controlled by property "num-stacks".
>> pnv_pec_instance_init() creates the maximum supported number, because
>> the property has not been set then.  pnv_pec_realize() realizes only
>> the wanted number.  Works, although it can leave unrealized devices
>> hanging around in the QOM composition tree.  Affects machine powernv9.
>
> I have used this pattern in many models. Is there a better one ?

The pattern is just fine, we just need to unparent any devices that turn
out to be unwanted.

Of course, when we already know what's wanted at instance_init time,
there's no reason for creating more.


Reply via email to