Received: from eggs.gnu.org ([2001:4830:134:3::10]:58799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrqCT-0005zD-Ur for qemu-devel@nongnu.org; Mon, 11 May 2015 12:05:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrqCS-00080N-Uy for qemu-devel@nongnu.org; Mon, 11 May 2015 12:05:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrqCS-00080G-M5 for qemu-devel@nongnu.org; Mon, 11 May 2015 12:05:00 -0400 Date: Mon, 11 May 2015 13:04:48 -0300 From: Eduardo Habkost Message-ID: <20150511160448.GQ17796@thinpad.lan.raisama.net> References: <1431078696-29519-1-git-send-email-bharata@linux.vnet.ibm.com> <1431078696-29519-2-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431078696-29519-2-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC v1 PATCH 1/3] cpus: Add Error argument to cpu_exec_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: zhugh.fnst@cn.fujitsu.com, agraf@suse.de, qemu-devel@nongnu.org, imammedo@redhat.com, afaerber@suse.de, david@gibson.dropbear.id.au 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 > Reviewed-by: David Gibson > --- [...] > 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