render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
99cbc7
From 7dff909fa34bdd93ad200dbffe70c0c1ee931925 Mon Sep 17 00:00:00 2001
99cbc7
Message-Id: <7dff909fa34bdd93ad200dbffe70c0c1ee931925@dist-git>
99cbc7
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
99cbc7
Date: Wed, 17 Sep 2014 19:00:58 +0200
99cbc7
Subject: [PATCH] RHEL: Fix maxvcpus output
99cbc7
99cbc7
https://bugzilla.redhat.com/show_bug.cgi?id=1092363
99cbc7
99cbc7
RHEL-only.
99cbc7
99cbc7
Ignore the maximum vcpu limit (KVM_CAP_MAX_VCPUS) on RHEL,
99cbc7
since RHEL QEMU treats the recommended limit (KVM_CAP_NR_VCPUS)
99cbc7
as the maximum, see:
99cbc7
https://bugzilla.redhat.com/show_bug.cgi?id=998708
99cbc7
99cbc7
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
99cbc7
---
99cbc7
 src/util/virhostcpu.c | 5 +++++
99cbc7
 1 file changed, 5 insertions(+)
99cbc7
99cbc7
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
99cbc7
index 013c95bb56..3f7d70b87b 100644
99cbc7
--- a/src/util/virhostcpu.c
99cbc7
+++ b/src/util/virhostcpu.c
99cbc7
@@ -1214,6 +1214,11 @@ virHostCPUGetKVMMaxVCPUs(void)
99cbc7
         return -1;
99cbc7
     }
99cbc7
 
99cbc7
+/* Ignore KVM_CAP_MAX_VCPUS on RHEL - the recommended maximum
99cbc7
+ * is treated as a hard limit.
99cbc7
+ */
99cbc7
+# undef KVM_CAP_MAX_VCPUS
99cbc7
+
99cbc7
 # ifdef KVM_CAP_MAX_VCPUS
99cbc7
     /* at first try KVM_CAP_MAX_VCPUS to determine the maximum count */
99cbc7
     if ((ret = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_MAX_VCPUS)) > 0)
99cbc7
-- 
99cbc7
2.18.0
99cbc7