qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH qom-cpu v2 19/29] cpu: Replace cpu_single_env wi


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH qom-cpu v2 19/29] cpu: Replace cpu_single_env with CPUState cpu_single_cpu
Date: Wed, 19 Jun 2013 14:59:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

Il 18/06/2013 18:52, Andreas Färber ha scritto:
> Am 16.06.2013 22:49, schrieb Blue Swirl:
>> On Sun, Jun 16, 2013 at 3:57 PM, Andreas Färber <address@hidden> 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?
> 
> 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 = ENV_GET_CPU(current_env);
> kvm-all.c:        bp = kvm_find_sw_breakpoint(current_cpu, addr);
> kvm-all.c:        err = kvm_arch_insert_sw_breakpoint(current_cpu, bp);
> kvm-all.c:
> QTAILQ_INSERT_HEAD(&current_cpu->kvm_state->kvm_sw_breakpoints,
> kvm-all.c:    CPUState *current_cpu = ENV_GET_CPU(current_env);
> kvm-all.c:        bp = kvm_find_sw_breakpoint(current_cpu, addr);
> kvm-all.c:        err = kvm_arch_remove_sw_breakpoint(current_cpu, bp);
> kvm-all.c:
> QTAILQ_REMOVE(&current_cpu->kvm_state->kvm_sw_breakpoints, bp, entry);
> kvm-all.c:    CPUState *current_cpu = ENV_GET_CPU(current_env);
> kvm-all.c:    KVMState *s = current_cpu->kvm_state;
> kvm-all.c:        if (kvm_arch_remove_sw_breakpoint(current_cpu, bp) != 0) {
> 
> but we could probably ignore these variable shadowings.

Renaming those to just "cpu" and "env" is pre-acked.

Paolo



reply via email to

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