qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	anthony@codemonkey.ws, gleb@redhat.com
Subject: [Qemu-devel] [PULL 7/9] kvm-all.c: max_cpus should not exceed KVM vcpu limit
Date: Fri, 23 Aug 2013 11:39:51 +0200	[thread overview]
Message-ID: <1377250793-24027-8-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1377250793-24027-1-git-send-email-pbonzini@redhat.com>

From: Marcelo Tosatti <mtosatti@redhat.com>

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>
---
 kvm-all.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kvm-all.c b/kvm-all.c
index ef52a0f..a2d4978 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -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
-- 
1.8.3.1

  parent reply	other threads:[~2013-08-23  9:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23  9:39 [Qemu-devel] [PULL 0/9] KVM changes for 2013-08-23 Paolo Bonzini
2013-08-23  9:39 ` [Qemu-devel] [PULL 1/9] Initialize IA32_FEATURE_CONTROL MSR in reset and migration Paolo Bonzini
2013-08-23 10:10   ` Andreas Färber
2013-08-23 10:11     ` Paolo Bonzini
2013-08-23  9:39 ` [Qemu-devel] [PULL 2/9] target-i386: remove tabs from target-i386/cpu.h Paolo Bonzini
2013-08-23  9:39 ` [Qemu-devel] [PULL 3/9] kvm: migrate vPMU state Paolo Bonzini
2013-08-23  9:39 ` [Qemu-devel] [PULL 4/9] kvm: add KVM_IRQFD_FLAG_RESAMPLE support Paolo Bonzini
2013-08-23  9:39 ` [Qemu-devel] [PULL 5/9] kvm: x86: fix setting IA32_FEATURE_CONTROL with nested VMX disabled Paolo Bonzini
2013-08-23  9:39 ` [Qemu-devel] [PULL 6/9] kvm: Simplify kvm_handle_io Paolo Bonzini
2013-08-23  9:39 ` Paolo Bonzini [this message]
2013-08-23  9:39 ` [Qemu-devel] [PULL 8/9] kvm: i386: fix LAPIC TSC deadline timer save/restore Paolo Bonzini
2013-08-23  9:39 ` [Qemu-devel] [PULL 9/9] kvm: shorten the parameter list for get_real_device() Paolo Bonzini
2013-08-24  2:34   ` Wei Yang
  -- strict thread matches above, loose matches on Subject: below --
2013-08-24  3:55 [Qemu-devel] [PULL v2 0/9] KVM changes for 2013-08-23 Paolo Bonzini
2013-08-24  3:55 ` [Qemu-devel] [PULL 7/9] kvm-all.c: max_cpus should not exceed KVM vcpu limit Paolo Bonzini
2013-08-24  3:49 [Qemu-devel] [PULL 0/9] KVM changes for 2013-08-23 Paolo Bonzini
2013-08-24  3:50 ` [Qemu-devel] [PULL 7/9] kvm-all.c: max_cpus should not exceed KVM vcpu limit Paolo Bonzini
2013-08-23  9:03 [Qemu-devel] [PULL 0/9] KVM changes for 2013-08-23 Paolo Bonzini
2013-08-23  9:03 ` [Qemu-devel] [PULL 7/9] kvm-all.c: max_cpus should not exceed KVM vcpu limit Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377250793-24027-8-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=gleb@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).