954c63
From 16b9ab85b004308e1d99db4ed4769a5fa56e2dfa Mon Sep 17 00:00:00 2001
954c63
Message-Id: <16b9ab85b004308e1d99db4ed4769a5fa56e2dfa@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
954c63
index a07c00a0e9..35f41daef2 100644
0b8103
--- a/src/util/virhostcpu.c
0b8103
+++ b/src/util/virhostcpu.c
954c63
@@ -1166,6 +1166,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