Re: [PATCH]3/5 Using kvm_arch prefix to define functions, and replace

Hollis Blanchard
2007-11-08T20:57:41Z

On Thu, 2007-11-08 at 15:21 +0800, Zhang, Xiantao wrote:
> @@ -890,7 +890,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm
> *kvm,
> int n)
> if (!valid_vcpu(n))
> return -EINVAL;
>
> - vcpu = kvm_x86_ops->vcpu_create(kvm, n);
> + vcpu = kvm_arch_vcpu_create(kvm, n);
> if (IS_ERR(vcpu))
> return PTR_ERR(vcpu);
>
> @@ -900,7 +900,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm
> *kvm,
> int n)
> BUG_ON((unsigned long)&vcpu->host_fx_image & 0xF);
>
> vcpu_load(vcpu);
> - r = kvm_x86_ops->vcpu_reset(vcpu);
> + r = kvm_arch_vcpu_reset(vcpu);
> if (r == 0)
> r = kvm_mmu_setup(vcpu);
> vcpu_put(vcpu);
> @@ -933,7 +933,7 @@ mmu_unload:
> vcpu_put(vcpu);
>
> free_vcpu:
> - kvm_x86_ops->vcpu_free(vcpu);
> + kvm_arch_vcpu_free(vcpu);
> return r;
> }

Have a look at the patch I posted on Wednesday: "[PATCH 2 of 2] RFC:
Create kvm_arch_vcpu_create()". kvm_arch_vcpu_create() will actually
encompass more logic from kvm_vm_ioctl_create_vcpu(), and once you do
that, kvm_arch_vcpu_reset() doesn't need to exist (which will also make
Carsten happy).

--
Hollis Blanchard
IBM Linux Technology Center