diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2013-08-12 16:56:31 -0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-08-20 18:38:35 +0200 |
commit | 7dc52526850849e8e0fe56ced809d0798481a2f6 (patch) | |
tree | 5d385020e7c2eebd798b22299f7c9476f4a519c4 /kvm-all.c | |
parent | 354678c5ce162649906e4e1be2859f3df372668f (diff) |
kvm-all.c: max_cpus should not exceed KVM vcpu limit
maxcpus, which specifies the maximum number of hotpluggable CPUs,
should not exceed KVM's vcpu limit.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
[Reword message. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r-- | kvm-all.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1400,6 +1400,13 @@ int kvm_init(void) goto err; } + if (max_cpus > max_vcpus) { + ret = -EINVAL; + fprintf(stderr, "Number of hotpluggable cpus requested (%d) exceeds max cpus " + "supported by KVM (%d)\n", max_cpus, max_vcpus); + goto err; + } + s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0); if (s->vmfd < 0) { #ifdef TARGET_S390X |