On Fri, May 08, 2015 at 03:21:34PM +0530, Bharata B Rao wrote: > Add an Error argument to cpu_exec_init() to let users collect the > error. Change all callers to currently pass NULL error argument. This change > is needed for the following reasons: > > - A subsequent commit changes the CPU enumeration logic in cpu_exec_init() > resulting in cpu_exec_init() to fail if cpu_index values corresponding > to max_cpus have already been handed out. > - Archs like PowerPC and x86 want cpu_exec_init() to be called from realize > rather than instance_init. With this change, those architectures > that can move this call into realize function can do so in a phased > manner. > > Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> > Reviewed-by: David Gibson <da...@gibson.dropbear.id.au> > --- [...] > diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c > index a98b7d8..0a0c21e 100644 > --- a/target-alpha/cpu.c > +++ b/target-alpha/cpu.c > @@ -257,7 +257,7 @@ static void alpha_cpu_initfn(Object *obj) > CPUAlphaState *env = &cpu->env; > > cs->env_ptr = env; > - cpu_exec_init(env); > + cpu_exec_init(env, NULL);
If cpu_exec_init() fails, we don't want to silently ignore the error. If you can't report the error back to the caller, you can use &error_abort to make QEMU abort on errors. -- Eduardo