diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-10-07 20:50:48 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:50 -0500 |
commit | 76fafa5e22bd82e92d2734852ba23f17322d675a (patch) | |
tree | f7b81035e86b5b26cbb2d2d13958c805f4990589 /drivers/kvm/svm.c | |
parent | d589444e924bc72e42fa94853f9096589d69374d (diff) |
KVM: Hoist kvm_create_lapic() into kvm_vcpu_init()
Move kvm_create_lapic() into kvm_vcpu_init(), rather than having svm
and vmx do it. And make it return the error rather than a fairly
random -ENOMEM.
This also solves the problem that neither svm.c nor vmx.c actually
handles the error path properly.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index f268bd51f337..fb2e591d5397 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -588,12 +588,6 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | |||
588 | if (err) | 588 | if (err) |
589 | goto free_svm; | 589 | goto free_svm; |
590 | 590 | ||
591 | if (irqchip_in_kernel(kvm)) { | ||
592 | err = kvm_create_lapic(&svm->vcpu); | ||
593 | if (err < 0) | ||
594 | goto free_svm; | ||
595 | } | ||
596 | |||
597 | page = alloc_page(GFP_KERNEL); | 591 | page = alloc_page(GFP_KERNEL); |
598 | if (!page) { | 592 | if (!page) { |
599 | err = -ENOMEM; | 593 | err = -ENOMEM; |