render / rpms / libvirt

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