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.
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....]
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"