File libvirt-qemu-Remove-maximum-cpu-limit-when-setting-processor-count-using-the-API.patch of Package libvirt
From 95697c10e5efb018dccc51e0d42b1d1c6f2846f9 Mon Sep 17 00:00:00 2001
Message-Id: <95697c10e5efb018dccc51e0d42b1d1c6f2846f9.1373885146.git.jdenemar@redhat.com>
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 13 Jun 2013 15:48:10 +0200
Subject: [PATCH] qemu: Remove maximum cpu limit when setting processor count
using the API
https://bugzilla.redhat.com/show_bug.cgi?id=855296
When setting processor count for a domain using the API libvirt enforced
a maximum processor count, while it isn't enforced when taking the XML path.
This patch removes the check to match the XML.
(cherry picked from commit ce65b435899066243c303dd1cefd671de46ae592)
Conflicts:
src/qemu/qemu_driver.c: context
---
src/qemu/qemu_driver.c | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c39690d..e28d8b7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3925,8 +3925,6 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainDefPtr persistentDef;
- const char * type;
- int max;
int ret = -1;
bool maximum;
@@ -3969,27 +3967,11 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
goto endjob;
}
- if (!(type = virDomainVirtTypeToString(vm->def->virtType))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown virt type in domain definition '%d'"),
- vm->def->virtType);
- 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.8.3.2