commit | 39c3b86e5c193e09f69f0e99c93600a4999ffc60 | [log] [tgz] |
---|---|---|
author | Avi Kivity <avi@qumranet.com> | Thu Jun 07 19:11:53 2007 +0300 |
committer | Avi Kivity <avi@qumranet.com> | Mon Jul 16 12:05:46 2007 +0300 |
tree | 94272c98789224f53d4f4f19587a08d95103f837 | |
parent | 72d6e5a08a8ba2105b3f36e32285e8fbfbed1f71 [diff] [blame] |
KVM: Keep an upper bound of initialized vcpus That way, we don't need to loop for KVM_MAX_VCPUS for a single vcpu vm. Signed-off-by: Avi Kivity <avi@qumranet.com>
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 5564169..4e1a017 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c
@@ -2391,6 +2391,11 @@ if (r < 0) goto out_free_vcpus; + spin_lock(&kvm_lock); + if (n >= kvm->nvcpus) + kvm->nvcpus = n + 1; + spin_unlock(&kvm_lock); + return r; out_free_vcpus: