From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpI06-0002P7-B2 for qemu-devel@nongnu.org; Wed, 19 Jun 2013 09:00:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpI05-0002wb-17 for qemu-devel@nongnu.org; Wed, 19 Jun 2013 09:00:38 -0400 Message-ID: <51C1AB41.5070601@redhat.com> Date: Wed, 19 Jun 2013 14:59:45 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1371398269-6213-1-git-send-email-afaerber@suse.de> <1371398269-6213-20-git-send-email-afaerber@suse.de> <51C0903A.2060508@suse.de> In-Reply-To: <51C0903A.2060508@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu v2 19/29] cpu: Replace cpu_single_env with CPUState cpu_single_cpu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: Peter Maydell , Anthony Liguori , qemu-devel@nongnu.org, Alexander Graf , Blue Swirl , =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , Paul Brook , Scott Wood , qemu-ppc , Aurelien Jarno , Richard Henderson Il 18/06/2013 18:52, Andreas F=C3=A4rber ha scritto: > Am 16.06.2013 22:49, schrieb Blue Swirl: >> On Sun, Jun 16, 2013 at 3:57 PM, Andreas F=C3=A4rber wrote: >>> Move it to qom/cpu.h. >> >> While renaming, perhaps a more descriptive name could be used instead >> of 'cpu_single_cpu', something like cpu_loop_current_cpu? >=20 > There were some local variables named cpu_single_cpu (blame me :)) that > this way simply fall away, but I can certainly rename it, adding just a > few lines to the patch. >=20 > However, cpu_loop_current_cpu seems to codify that we have a sequential > loop of vCPUs, which Xen and IIUC KVM do not have and occasionally > people have looked into changing for TCG. >=20 > current_cpu is already used in a few places: >=20 > include/sysemu/kvm.h:int kvm_arch_insert_sw_breakpoint(CPUState > *current_cpu, > include/sysemu/kvm.h:int kvm_arch_remove_sw_breakpoint(CPUState > *current_cpu, > kvm-all.c: CPUState *current_cpu =3D ENV_GET_CPU(current_env); > kvm-all.c: bp =3D kvm_find_sw_breakpoint(current_cpu, addr); > kvm-all.c: err =3D kvm_arch_insert_sw_breakpoint(current_cpu, bp= ); > kvm-all.c: > QTAILQ_INSERT_HEAD(¤t_cpu->kvm_state->kvm_sw_breakpoints, > kvm-all.c: CPUState *current_cpu =3D ENV_GET_CPU(current_env); > kvm-all.c: bp =3D kvm_find_sw_breakpoint(current_cpu, addr); > kvm-all.c: err =3D kvm_arch_remove_sw_breakpoint(current_cpu, bp= ); > kvm-all.c: > QTAILQ_REMOVE(¤t_cpu->kvm_state->kvm_sw_breakpoints, bp, entry); > kvm-all.c: CPUState *current_cpu =3D ENV_GET_CPU(current_env); > kvm-all.c: KVMState *s =3D current_cpu->kvm_state; > kvm-all.c: if (kvm_arch_remove_sw_breakpoint(current_cpu, bp) !=3D= 0) { >=20 > but we could probably ignore these variable shadowings. Renaming those to just "cpu" and "env" is pre-acked. Paolo