qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 7/8] cpus: Change exec_init() arg to cpu, not


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v3 7/8] cpus: Change exec_init() arg to cpu, not env
Date: Thu, 18 Jun 2015 16:35:37 -0300
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Jun 18, 2015 at 10:24:54AM -0700, Peter Crosthwaite wrote:
[...]
> diff --git a/exec.c b/exec.c
> index b1c8aae..7fc1950 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -554,9 +554,8 @@ void cpu_exec_exit(CPUState *cpu)
>  }
>  #endif
>  
> -void cpu_exec_init(CPUArchState *env, Error **errp)
> +void cpu_exec_init(CPUState *cpu, Error **errp)
>  {
> -    CPUState *cpu = ENV_GET_CPU(env);
>      CPUClass *cc = CPU_GET_CLASS(cpu);
>      int cpu_index;
>      Error *local_err = NULL;
> @@ -585,6 +584,7 @@ void cpu_exec_init(CPUArchState *env, Error **errp)
>          vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu);
>      }
>  #if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
> +    CPUArchState *env = cpu->env_ptr;

Mixed declarations (declarations that are not a the beginning of a
block) are not allowed by QEMU coding style. It looks simpler to just
eliminate the variable and use cpu->env_ptr directly at the
register_savevm() call below.

>      register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION,
>                      cpu_save, cpu_load, env);
>      assert(cc->vmsd == NULL);

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]