From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7a83-0001IG-E6 for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:09:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7a7z-0008UB-EW for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:09:31 -0400 Received: from mail-yk0-f173.google.com ([209.85.160.173]:33038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7a7z-0008Tz-AT for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:09:27 -0400 Received: by ykdt186 with SMTP id t186so16421673ykd.0 for ; Tue, 23 Jun 2015 19:09:26 -0700 (PDT) MIME-Version: 1.0 Sender: peter.crosthwaite@petalogix.com In-Reply-To: <20150618193537.GJ3874@thinpad.lan.raisama.net> References: <1434648295-30584-1-git-send-email-crosthwaite.peter@gmail.com> <1434648295-30584-8-git-send-email-crosthwaite.peter@gmail.com> <20150618193537.GJ3874@thinpad.lan.raisama.net> Date: Tue, 23 Jun 2015 19:09:26 -0700 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3 7/8] cpus: Change exec_init() arg to cpu, not env List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Peter Maydell , Jia Liu , Peter Crosthwaite , Bastian Koppelmann , Anthony Green , Mark Cave-Ayland , "qemu-devel@nongnu.org Developers" , Alexander Graf , Blue Swirl , Max Filippov , Peter Crosthwaite , Michael Walle , Paolo Bonzini , "Edgar E. Iglesias" , Guan Xuetao , Leon Alrae , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Aurelien Jarno , Richard Henderson On Thu, Jun 18, 2015 at 12:35 PM, Eduardo Habkost wrote: > 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. > Fixed in v4. Regards, Peter >> register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION, >> cpu_save, cpu_load, env); >> assert(cc->vmsd == NULL); > > -- > Eduardo >