public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, gleb@redhat.com,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: [uq/master patch 2/2] kvm-all.c: max_cpus should not exceed KVM vcpu limit
Date: Mon, 12 Aug 2013 16:56:31 -0300	[thread overview]
Message-ID: <20130812195730.363325196@redhat.com> (raw)
In-Reply-To: 20130812195629.350634011@redhat.com

[-- Attachment #1: kvm-all-check-max-cpus --]
[-- Type: text/plain, Size: 684 bytes --]

maxcpus, which specifies the maximum number of hotpluggable CPUs,
should not exceed KVM's vcpu limit.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Index: qemu/kvm-all.c
===================================================================
--- qemu.orig/kvm-all.c
+++ qemu/kvm-all.c
@@ -1391,6 +1391,13 @@ int kvm_init(void)
         goto err;
     }
 
+    if (max_cpus > max_vcpus) {
+        ret = -EINVAL;
+        fprintf(stderr, "Number of max_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



  parent reply	other threads:[~2013-08-12 19:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 19:56 [uq/master patch 0/2] kvm max vcpu limit fixes Marcelo Tosatti
2013-08-12 19:56 ` [uq/master patch 1/2] kvm-all.c: use recommended max vcpus limit Marcelo Tosatti
2013-08-18 15:28   ` Paolo Bonzini
2013-08-18 16:15     ` Marcelo Tosatti
2013-08-12 19:56 ` Marcelo Tosatti [this message]
2013-08-20 16:44   ` [uq/master patch 2/2] 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=20130812195730.363325196@redhat.com \
    --to=mtosatti@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /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