render / rpms / libvirt

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