0b8103
From 8232ba78dea7336282f65e94d575beb9b27d03f4 Mon Sep 17 00:00:00 2001
0b8103
Message-Id: <8232ba78dea7336282f65e94d575beb9b27d03f4@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
0b8103
index 7aa92ad11d..337f03b41b 100644
0b8103
--- a/src/util/virhostcpu.c
0b8103
+++ b/src/util/virhostcpu.c
0b8103
@@ -1192,6 +1192,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
-- 
0b8103
2.32.0
0b8103