On 13 April 2012 08:59, Paolo Bonzini <pbonz...@redhat.com> wrote: > 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.
Half a dozen from random grep: "a9mpcore_priv" (and its equivalents for a15, 11mpcore, etc) "xilinx,timer" -- memory region size depends on a property "SUNW,tcx" -- number of memory regions depend on depth property "arm_mptimer" -- number of regions and irqs depends on 'num-cpu' prop "grlib,gptimer" -- number of irqs depends on "nr-timers" prop "lan9118" -- which MemoryRegionOps we use for the region depends on the "mode_16bit" property. -- PMM