mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 19:45:21 +00:00
qemu: check if numa cell's cpu range match with cpu topology count
QEMU shows a warning message if partial NUMA mapping is set. This patch adds a warning message in libvirt when editing the XML. It must be an error in future, when QEMU remove this ability. Signed-off-by: Maxiwell S. Garcia <maxiwell@linux.ibm.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
b18c273a24
commit
38d2e03368
@ -4621,17 +4621,26 @@ qemuDomainDefValidate(const virDomainDef *def,
|
|||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS)) {
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS)) {
|
||||||
unsigned int topologycpus;
|
unsigned int topologycpus;
|
||||||
unsigned int granularity;
|
unsigned int granularity;
|
||||||
|
unsigned int numacpus;
|
||||||
|
|
||||||
/* Starting from QEMU 2.5, max vCPU count and overall vCPU topology
|
/* Starting from QEMU 2.5, max vCPU count and overall vCPU topology
|
||||||
* must agree. We only actually enforce this with QEMU 2.7+, due
|
* must agree. We only actually enforce this with QEMU 2.7+, due
|
||||||
* to the capability check above */
|
* to the capability check above */
|
||||||
if (virDomainDefGetVcpusTopology(def, &topologycpus) == 0 &&
|
if (virDomainDefGetVcpusTopology(def, &topologycpus) == 0) {
|
||||||
topologycpus != virDomainDefGetVcpusMax(def)) {
|
if (topologycpus != virDomainDefGetVcpusMax(def)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("CPU topology doesn't match maximum vcpu count"));
|
_("CPU topology doesn't match maximum vcpu count"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
numacpus = virDomainNumaGetCPUCountTotal(def->numa);
|
||||||
|
if ((numacpus != 0) && (topologycpus != numacpus)) {
|
||||||
|
VIR_WARN("CPU topology doesn't match numa CPU count; "
|
||||||
|
"partial NUMA mapping is obsoleted and will "
|
||||||
|
"be removed in future");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* vCPU hotplug granularity must be respected */
|
/* vCPU hotplug granularity must be respected */
|
||||||
granularity = qemuDomainDefGetVcpuHotplugGranularity(def);
|
granularity = qemuDomainDefGetVcpuHotplugGranularity(def);
|
||||||
if ((virDomainDefGetVcpus(def) % granularity) != 0) {
|
if ((virDomainDefGetVcpus(def) % granularity) != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user