Re: [Qemu-devel] [PATCH 4/7] provide opaque CPUState to files that are compiled once

2010-06-28 Thread Paolo Bonzini
On 06/27/2010 09:17 PM, Blue Swirl wrote: I'm not comfortable with this part. Accidental use of the global register variable can cause subtle bugs. I'd rather rename 'env' to something more obvious and less likely to collide, like 'global_reg_env' and always poison that. Then we could replace

Re: [Qemu-devel] [PATCH 4/7] provide opaque CPUState to files that are compiled once

2010-06-28 Thread Blue Swirl
On Mon, Jun 28, 2010 at 8:04 AM, Paolo Bonzini pbonz...@redhat.com wrote: On 06/27/2010 09:17 PM, Blue Swirl wrote: I'm not comfortable with this part. Accidental use of the global register variable can cause subtle bugs. I'd rather rename 'env' to something more obvious and less likely to

Re: [Qemu-devel] [PATCH 4/7] provide opaque CPUState to files that are compiled once

2010-06-27 Thread Blue Swirl
On Fri, Jun 25, 2010 at 12:52 PM, Paolo Bonzini pbonz...@redhat.com wrote: This patch unpoisons CPUState and env in once-compiled files. To achieve this, it defines an opaque struct CPUState in cpu-common.h. This also requires tweaking the relationship between CPUState and CPUXYZState in

[Qemu-devel] [PATCH 4/7] provide opaque CPUState to files that are compiled once

2010-06-25 Thread Paolo Bonzini
This patch unpoisons CPUState and env in once-compiled files. To achieve this, it defines an opaque struct CPUState in cpu-common.h. This also requires tweaking the relationship between CPUState and CPUXYZState in target files. Unpoisoning env is needed because it is widely used as the name for