render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From aa8480d804ae24514b51d262ad0edb3d509ecbd6 Mon Sep 17 00:00:00 2001
Message-Id: <aa8480d804ae24514b51d262ad0edb3d509ecbd6@dist-git>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Wed, 17 Sep 2014 19:00:58 +0200
Subject: [PATCH] RHEL: Fix maxvcpus output

https://bugzilla.redhat.com/show_bug.cgi?id=1092363

RHEL-only.

Ignore the maximum vcpu limit (KVM_CAP_MAX_VCPUS) on RHEL,
since RHEL QEMU treats the recommended limit (KVM_CAP_NR_VCPUS)
as the maximum, see:
https://bugzilla.redhat.com/show_bug.cgi?id=998708

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_driver.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d3ff143..0a5605a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1211,6 +1211,11 @@ kvmGetMaxVCPUs(void)
         return -1;
     }
 
+/* Ignore KVM_CAP_MAX_VCPUS on RHEL - the recommended maximum
+ * is treated as a hard limit.
+ */
+#undef KVM_CAP_MAX_VCPUS
+
 #ifdef KVM_CAP_MAX_VCPUS
     /* at first try KVM_CAP_MAX_VCPUS to determine the maximum count */
     if ((ret = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_MAX_VCPUS)) > 0)
-- 
2.1.0