From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5fbH-0003yq-E4 for qemu-devel@nongnu.org; Thu, 18 Jun 2015 15:35:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5fbC-0008SD-4F for qemu-devel@nongnu.org; Thu, 18 Jun 2015 15:35:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5fbB-0008RA-Uy for qemu-devel@nongnu.org; Thu, 18 Jun 2015 15:35:42 -0400 Date: Thu, 18 Jun 2015 16:35:37 -0300 From: Eduardo Habkost Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1434648295-30584-8-git-send-email-crosthwaite.peter@gmail.com> 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: Peter Crosthwaite Cc: Peter Maydell , Jia Liu , Peter Crosthwaite , Bastian Koppelmann , Anthony Green , Mark Cave-Ayland , qemu-devel@nongnu.org, Alexander Graf , Blue Swirl , Max Filippov , Michael Walle , "Edgar E. Iglesias" , Paolo Bonzini , Guan Xuetao , Leon Alrae , afaerber@suse.de, aurelien@aurel32.net, rth@twiddle.net 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