[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v1 PATCH 1/3] cpus: Add Error argument to cpu_exec
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [RFC v1 PATCH 1/3] cpus: Add Error argument to cpu_exec_init() |
Date: |
Mon, 11 May 2015 13:04:48 -0300 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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 <address@hidden>
> Reviewed-by: David Gibson <address@hidden>
> ---
[...]
> 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
[Qemu-devel] [RFC v1 PATCH 3/3] ppc: Move cpu_exec_init() call to realize function, Bharata B Rao, 2015/05/08