9ae3a8
From 3513ae9049f3587572997f2728e219be11679da8 Mon Sep 17 00:00:00 2001
9ae3a8
From: Andrew Jones <drjones@redhat.com>
9ae3a8
Date: Tue, 21 Jan 2014 10:46:52 +0100
9ae3a8
Subject: [PATCH 31/34] use recommended max vcpu count
9ae3a8
9ae3a8
RH-Author: Andrew Jones <drjones@redhat.com>
9ae3a8
Message-id: <1390301212-15344-1-git-send-email-drjones@redhat.com>
9ae3a8
Patchwork-id: 56862
9ae3a8
O-Subject: [RHEL7.0 qemu-kvm PATCH v6] use recommended max vcpu count
9ae3a8
Bugzilla: 998708
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
9ae3a8
9ae3a8
RHEL-only
9ae3a8
Bugzilla: 998708
9ae3a8
Brew: 6905708
9ae3a8
9ae3a8
The recommended vcpu max limit (KVM_CAP_NR_VCPUS) should be used instead
9ae3a8
of the actual max vcpu limit (KVM_CAP_MAX_VCPUS) to give an error.
9ae3a8
9ae3a8
This matches the limit tested by QE on RHEL6: 160.
9ae3a8
9ae3a8
Signed-off-by: Andrew Jones <drjones@redhat.com>
9ae3a8
---
9ae3a8
 kvm-all.c | 3 +++
9ae3a8
 1 file changed, 3 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 kvm-all.c |    3 +++
9ae3a8
 1 files changed, 3 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
diff --git a/kvm-all.c b/kvm-all.c
9ae3a8
index 19acd58..603bd4b 100644
9ae3a8
--- a/kvm-all.c
9ae3a8
+++ b/kvm-all.c
9ae3a8
@@ -1350,6 +1350,9 @@ int kvm_init(void)
9ae3a8
     soft_vcpus_limit = kvm_recommended_vcpus(s);
9ae3a8
     hard_vcpus_limit = kvm_max_vcpus(s);
9ae3a8
 
9ae3a8
+    /* RHEL doesn't support nr_vcpus > soft_vcpus_limit */
9ae3a8
+    hard_vcpus_limit = soft_vcpus_limit;
9ae3a8
+
9ae3a8
     while (nc->name) {
9ae3a8
         if (nc->num > soft_vcpus_limit) {
9ae3a8
             fprintf(stderr,
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8