render / rpms / libvirt

Forked from rpms/libvirt 4 months ago
Clone
9de337
From ce1f2d4397f1c3fe3bf87e8b49736bf3c5000de8 Mon Sep 17 00:00:00 2001
9de337
Message-Id: <ce1f2d4397f1c3fe3bf87e8b49736bf3c5000de8@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
9de337
index 7aa92ad11d..337f03b41b 100644
d76c62
--- a/src/util/virhostcpu.c
d76c62
+++ b/src/util/virhostcpu.c
9de337
@@ -1192,6 +1192,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
-- 
9de337
2.32.0
d76c62