Re: [kvm-ppc-devel] [PATCH] Split kvm_vcpu to support new archs.

Carsten Otte
2007-10-19T13:34:20Z

Hollis Blanchard wrote:
> I must be misunderstanding, because this seems completely backwards to
> me. With your nesting, any time architecture code wants to access
> architecture state (which is almost all the time), you'd *need*
> container_of:
>
> void arch_func(struct kvm_vcpu *vcpu) {
> struct arch_vcpu *arch = container_of(vcpu, arch_vcpu,
> arch);
> arch->gpr[3] = 0;
> }
>
> In contrast, my nesting proposal would look like this:
>
> void arch_func(struct kvm_vcpu *vcpu) {
> vcpu->arch.gpr[3] = 0;
> }
>
I'm with Hollis on this one. It looks clearly preferable to me.