[PATCH] qemu: Remove limit enforcing when setting processor count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When setting processor count for a domain using the API libvirt enforced
a maximum processor count that was determined using an IOCTL on
/dev/kvm. Unfortunately this value isn't representative enough and qemu
happily accepts and starts with values greater than the reported value.

This patch removes the check so that users are able to use full
potential of their big boxes also when setting processor counts with the
API not just in XML.
---
 src/qemu/qemu_driver.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8e8e00c..6be3e5f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3595,7 +3595,6 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
     virDomainObjPtr vm;
     virDomainDefPtr persistentDef;
     const char * type;
-    int max;
     int ret = -1;
     bool maximum;

@@ -3645,20 +3644,11 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         goto endjob;
     }

-    if ((max = qemudGetMaxVCPUs(NULL, type)) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("could not determine max vcpus for the domain"));
-        goto endjob;
-    }
-
-    if (!maximum && vm->def->maxvcpus < max) {
-        max = vm->def->maxvcpus;
-    }
-
-    if (nvcpus > max) {
+    if (!maximum && nvcpus > vm->def->maxvcpus) {
         virReportError(VIR_ERR_INVALID_ARG,
                        _("requested vcpus is greater than max allowable"
-                         " vcpus for the domain: %d > %d"), nvcpus, max);
+                         " vcpus for the domain: %d > %d"),
+                       nvcpus, vm->def->maxvcpus);
         goto endjob;
     }

-- 
1.7.12

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]