mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
Added check for maximum number of vcpus exceeding topology limit
Earlier, when the number of vcpus was greater than the topology allowed, libvirt didn't raise an error and continued, resulting in running qemu with parameters making no sense. Even though qemu did not report any error itself, the number of vcpus was set to maximum allowed by the topology.
This commit is contained in:
parent
29db7a0072
commit
b54de0830a
1
AUTHORS
1
AUTHORS
@ -215,6 +215,7 @@ Patches have also been contributed by:
|
||||
Rommer <rommer@active.by>
|
||||
Yuri Chornoivan <yurchor@ukr.net>
|
||||
Deepak C Shetty <deepakcs@linux.vnet.ibm.com>
|
||||
Martin Kletzander <mkletzan@redhat.com>
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
||||
|
@ -8010,6 +8010,14 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
||||
if (def->cpu == NULL)
|
||||
goto error;
|
||||
|
||||
if (def->cpu->sockets &&
|
||||
def->maxvcpus >
|
||||
def->cpu->sockets * def->cpu->cores * def->cpu->threads) {
|
||||
virDomainReportError(VIR_ERR_XML_DETAIL, "%s",
|
||||
_("Maximum CPUs greater than topology limit"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (def->cpu->cells_cpus > def->maxvcpus) {
|
||||
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Number of CPUs in <numa> exceeds the"
|
||||
|
Loading…
x
Reference in New Issue
Block a user