Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 375270
b: refs/heads/master
c: 7dac16c
h: refs/heads/master
v: v3
  • Loading branch information
Asias He authored and Gleb Natapov committed May 8, 2013
1 parent 792c1c9 commit 5506426
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42bdf991f4cad9678ee2b98c5c2e9299a3f986ef
refs/heads/master: 7dac16c379a876e256bc7349cd80007e7f9f2b59
18 changes: 13 additions & 5 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3105,13 +3105,21 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
int r;
int cpu;

r = kvm_irqfd_init();
if (r)
goto out_irqfd;
r = kvm_arch_init(opaque);
if (r)
goto out_fail;

/*
* kvm_arch_init makes sure there's at most one caller
* for architectures that support multiple implementations,
* like intel and amd on x86.
* kvm_arch_init must be called before kvm_irqfd_init to avoid creating
* conflicts in case kvm is already setup for another implementation.
*/
r = kvm_irqfd_init();
if (r)
goto out_irqfd;

if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) {
r = -ENOMEM;
goto out_free_0;
Expand Down Expand Up @@ -3186,10 +3194,10 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
out_free_0a:
free_cpumask_var(cpus_hardware_enabled);
out_free_0:
kvm_arch_exit();
out_fail:
kvm_irqfd_exit();
out_irqfd:
kvm_arch_exit();
out_fail:
return r;
}
EXPORT_SYMBOL_GPL(kvm_init);
Expand Down

0 comments on commit 5506426

Please sign in to comment.