render / rpms / libvirt

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