mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-14 08:35:15 +00:00
qemu: Remove maximum cpu limit when setting processor count using the API
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.
This commit is contained in:
parent
56f27b3bbc
commit
ce65b43589
@ -3738,8 +3738,6 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||||
virDomainObjPtr vm = NULL;
|
virDomainObjPtr vm = NULL;
|
||||||
virDomainDefPtr persistentDef;
|
virDomainDefPtr persistentDef;
|
||||||
const char * type;
|
|
||||||
int max;
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
bool maximum;
|
bool maximum;
|
||||||
virQEMUDriverConfigPtr cfg = NULL;
|
virQEMUDriverConfigPtr cfg = NULL;
|
||||||
@ -3779,27 +3777,11 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(type = virDomainVirtTypeToString(vm->def->virtType))) {
|
if (!maximum && nvcpus > vm->def->maxvcpus) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("unknown virt type in domain definition '%d'"),
|
|
||||||
vm->def->virtType);
|
|
||||||
goto endjob;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((max = qemuGetMaxVCPUs(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) {
|
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
_("requested vcpus is greater than max allowable"
|
_("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;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user