mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-29 20:11:16 +00:00
numa_conf: Move memnode mode validation into virDomainNumaDefValidate()
When parsing a <memnode/> we also check whether the @mode argument fulfills some requirements wrt 'restrictive' mode. This is not the right place though. There's virDomainNumaDefValidate() which contains other checks. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
a152d856c3
commit
f6ba9fc12a
@ -191,14 +191,6 @@ virDomainNumatuneNodeParseXML(virDomainNuma *numa,
|
|||||||
VIR_DOMAIN_NUMATUNE_MEM_STRICT) < 0)
|
VIR_DOMAIN_NUMATUNE_MEM_STRICT) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (numa->memory.mode == VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE &&
|
|
||||||
mem_node->mode != VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
|
||||||
_("'restrictive' mode is required in memnode element "
|
|
||||||
"when mode is 'restrictive' in memory element"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = virXMLPropString(cur_node, "nodeset");
|
tmp = virXMLPropString(cur_node, "nodeset");
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
@ -1083,6 +1075,14 @@ virDomainNumaDefValidate(const virDomainNuma *def)
|
|||||||
const virDomainNumaNode *node = &def->mem_nodes[i];
|
const virDomainNumaNode *node = &def->mem_nodes[i];
|
||||||
g_autoptr(virBitmap) levelsSeen = virBitmapNew(0);
|
g_autoptr(virBitmap) levelsSeen = virBitmapNew(0);
|
||||||
|
|
||||||
|
if (virDomainNumatuneNodeSpecified(def, i) &&
|
||||||
|
def->memory.mode == VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE &&
|
||||||
|
node->mode != VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) {
|
||||||
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
_("'restrictive' mode is required in memnode element when mode is 'restrictive' in memory element"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
for (j = 0; j < node->ncaches; j++) {
|
for (j = 0; j < node->ncaches; j++) {
|
||||||
const virNumaCache *cache = &node->caches[j];
|
const virNumaCache *cache = &node->caches[j];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user