KVM: Dynamically allocate vcpus

This patch converts the vcpus array in "struct kvm" to a pointer
array, and changes the "vcpu_create" and "vcpu_setup" hooks into one
"vcpu_create" call which does the allocation and initialization of the
vcpu (calling back into the kvm_vcpu_init core helper).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
Rusty Russell
2007-07-27 17:16:56 +10:00
committed by Avi Kivity
parent a2fa3e9f52
commit fb3f0f51d9
5 changed files with 235 additions and 217 deletions

View File

@@ -23,7 +23,7 @@ static const u32 host_save_user_msrs[] = {
struct kvm_vcpu;
struct vcpu_svm {
struct kvm_vcpu *vcpu;
struct kvm_vcpu vcpu;
struct vmcb *vmcb;
unsigned long vmcb_pa;
struct svm_cpu_data *svm_data;