yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From a4ceb63bdc5cbac19f5f633ec761b9de0dedb55e Mon Sep 17 00:00:00 2001
From: Andrew Jones <drjones@redhat.com>
Date: Tue, 21 Jan 2014 10:46:52 +0100
Subject: use recommended max vcpu count

RH-Author: Andrew Jones <drjones@redhat.com>
Message-id: <1390301212-15344-1-git-send-email-drjones@redhat.com>
Patchwork-id: 56862
O-Subject: [RHEL7.0 qemu-kvm PATCH v6] use recommended max vcpu count
Bugzilla: 998708
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com>

The recommended vcpu max limit (KVM_CAP_NR_VCPUS) should be used instead
of the actual max vcpu limit (KVM_CAP_MAX_VCPUS) to give an error.

This matches the limit tested by QE on RHEL6: 160.

Signed-off-by: Andrew Jones <drjones@redhat.com>
(cherry picked from commit 0c77563da9357ff2738c4e23db2df39e1ac7b96e)
(cherry picked from commit 2e43df9e18ae22b4f57c31b01130755a3100f8cb)
---
 kvm-all.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kvm-all.c b/kvm-all.c
index 90b8573..a545d53 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1633,6 +1633,9 @@ static int kvm_init(MachineState *ms)
     soft_vcpus_limit = kvm_recommended_vcpus(s);
     hard_vcpus_limit = kvm_max_vcpus(s);
 
+    /* RHEL doesn't support nr_vcpus > soft_vcpus_limit */
+    hard_vcpus_limit = soft_vcpus_limit;
+
     while (nc->name) {
         if (nc->num > soft_vcpus_limit) {
             fprintf(stderr,
-- 
1.8.3.1