On Thu, May 22, 2014 at 12:49:26PM +0200, Andreas Färber wrote: > Hi, > > Am 22.05.2014 04:33, schrieb chen.fan.f...@cn.fujitsu.com: > > I think if we want to use 'device/device_add' to implement CPU, > > we must do some check before qemu_init_vcpu(). how can we to do that? > > We ran into such problems before... If need be, we can change from the > old parent_realize scheme to the base class calling the derived realize > function in-order, or we can add new hooks to CPUClass as necessary. > > Consider me a bit skeptical about MAX_CPUMASK_BITS in 1/3. This should > at least be tied to the maximum allowed for QEMUMachine/MachineClass > rather than hardcoded to 255, which people may forget to synchronize. > There was a recent attempt to increase the limits.
I agree that on new code we should avoid using static bitmap sizes and use max_cpus instead. MAX_CPUMASK_BITS only exists because there was existing code using static limits to bitmaps. If we change all existing code to use max_cpus to dynamically allocate bitmaps, we can drop it. -- Eduardo