18dc33
From 4e5854dd33f113e9aa81f7e1a23c50ac21dbefde Mon Sep 17 00:00:00 2001
18dc33
Message-Id: <4e5854dd33f113e9aa81f7e1a23c50ac21dbefde@dist-git>
0b8103
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
0b8103
Date: Mon, 27 Aug 2018 13:09:38 +0200
0b8103
Subject: [PATCH] RHEL: Fix virConnectGetMaxVcpus output
0b8103
MIME-Version: 1.0
0b8103
Content-Type: text/plain; charset=UTF-8
0b8103
Content-Transfer-Encoding: 8bit
0b8103
0b8103
https://bugzilla.redhat.com/show_bug.cgi?id=1092363
0b8103
0b8103
RHEL-only.
0b8103
0b8103
Ignore the maximum vcpu limit (KVM_CAP_MAX_VCPUS) on RHEL,
0b8103
since RHEL QEMU treats the recommended limit (KVM_CAP_NR_VCPUS)
0b8103
as the maximum, see:
0b8103
https://bugzilla.redhat.com/show_bug.cgi?id=998708
0b8103
0b8103
(cherry picked from commit 7dff909fa34bdd93ad200dbffe70c0c1ee931925)
0b8103
Signed-off-by: Ján Tomko <jtomko@redhat.com>
0b8103
0b8103
https: //bugzilla.redhat.com/show_bug.cgi?id=1582222
0b8103
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
0b8103
---
0b8103
 src/util/virhostcpu.c | 5 +++++
0b8103
 1 file changed, 5 insertions(+)
0b8103
0b8103
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
18dc33
index 67b6910626..d5d7d5eae0 100644
0b8103
--- a/src/util/virhostcpu.c
0b8103
+++ b/src/util/virhostcpu.c
18dc33
@@ -1189,6 +1189,11 @@ virHostCPUGetKVMMaxVCPUs(void)
0b8103
         return -1;
0b8103
     }
0b8103
 
0b8103
+/* Ignore KVM_CAP_MAX_VCPUS on RHEL - the recommended maximum
0b8103
+ * is treated as a hard limit.
0b8103
+ */
0b8103
+# undef KVM_CAP_MAX_VCPUS
0b8103
+
0b8103
 # ifdef KVM_CAP_MAX_VCPUS
0b8103
     /* at first try KVM_CAP_MAX_VCPUS to determine the maximum count */
0b8103
     if ((ret = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_MAX_VCPUS)) > 0)
0b8103
-- 
18dc33
2.34.1
0b8103