From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uoz8j-0000Uy-M3 for qemu-devel@nongnu.org; Tue, 18 Jun 2013 12:52:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uoz8f-0007fg-Ef for qemu-devel@nongnu.org; Tue, 18 Jun 2013 12:52:17 -0400 Message-ID: <51C0903A.2060508@suse.de> Date: Tue, 18 Jun 2013 18:52:10 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1371398269-6213-1-git-send-email-afaerber@suse.de> <1371398269-6213-20-git-send-email-afaerber@suse.de> In-Reply-To: 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: Blue Swirl , Paolo Bonzini Cc: Peter Maydell , Anthony Liguori , qemu-devel@nongnu.org, Alexander Graf , =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , Paul Brook , Scott Wood , qemu-ppc , Aurelien Jarno , Richard Henderson 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. >=20 > While renaming, perhaps a more descriptive name could be used instead > of 'cpu_single_cpu', something like cpu_loop_current_cpu? 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. 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. current_cpu is already used in a few places: 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) { but we could probably ignore these variable shadowings. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg