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: Fri, 13 Apr 2012 09:59:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Il 13/04/2012 09:30, Peter Maydell ha scritto:
> ...but it's not uncommon for the number of memory regions or
> IRQs to depend on some qdev property, so you can't put these
> calls in instance_init, that would be too early.

Do you have examples?  The only example I can find in the tree from a
quick grep is the OMAP modulecount.

>> Similarly, there is no reason why qdev_get_gpio_in can only be called
>> after qdev_init_nofail.  It's only like that because qdev_init_gpio_in
>> is called later than in the instance_init function.  Only a handful of
>> devices need a dynamic number of GPIO pins, everything else can call it
>> in instance_init.
> 
> I think a model that says "half our devices set up memory and
> IRQs in one function and the other half do it somewhere else"
> is pretty confusing. I'd rather have a single standard place
> where they can all set these up.

I don't think this is any different from "half our devices use #defines
and half our devices use qdev properties".

  Children can be created in initialization or creates children, and
realization

Paolo



reply via email to

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