virDomainNumatuneParseXML now doesn't allocate the def->numa object any longer so we don't need to pass a double pointer. --- src/conf/domain_conf.c | 2 +- src/conf/numa_conf.c | 23 +++++++++++------------ src/conf/numa_conf.h | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 83c5fd9..ceaf092 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13528,7 +13528,7 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } - if (virDomainNumatuneParseXML(&def->numa, + if (virDomainNumatuneParseXML(def->numa, def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC, def->cpu ? def->cpu->ncells : 0, diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 1b8232e..8adec6f 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -82,7 +82,7 @@ virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune, } static int -virDomainNumatuneNodeParseXML(virDomainNumaPtr *numatunePtr, +virDomainNumatuneNodeParseXML(virDomainNumaPtr numa, size_t ncells, xmlXPathContextPtr ctxt) { @@ -90,7 +90,6 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr *numatunePtr, int n = 0; int ret = -1; size_t i = 0; - virDomainNumaPtr numatune = *numatunePtr; xmlNodePtr *nodes = NULL; if ((n = virXPathNodeSet("./numatune/memnode", ctxt, &nodes)) < 0) { @@ -102,8 +101,8 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr *numatunePtr, if (!n) return 0; - if (numatune && numatune->memory.specified && - numatune->memory.placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO) { + if (numa->memory.specified && + numa->memory.placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Per-node binding is not compatible with " "automatic NUMA placement.")); @@ -117,11 +116,11 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr *numatunePtr, goto cleanup; } - VIR_FREE(numatune->mem_nodes); - if (VIR_ALLOC_N(numatune->mem_nodes, ncells) < 0) + VIR_FREE(numa->mem_nodes); + if (VIR_ALLOC_N(numa->mem_nodes, ncells) < 0) goto cleanup; - numatune->nmem_nodes = ncells; + numa->nmem_nodes = ncells; for (i = 0; i < n; i++) { int mode = 0; @@ -144,14 +143,14 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr *numatunePtr, } VIR_FREE(tmp); - if (cellid >= numatune->nmem_nodes) { + if (cellid >= numa->nmem_nodes) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Argument 'cellid' in memnode element must " "correspond to existing guest's NUMA cell")); goto cleanup; } - mem_node = &numatune->mem_nodes[cellid]; + mem_node = &numa->mem_nodes[cellid]; if (mem_node->nodeset) { virReportError(VIR_ERR_XML_ERROR, @@ -194,7 +193,7 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr *numatunePtr, } int -virDomainNumatuneParseXML(virDomainNumaPtr *numatunePtr, +virDomainNumatuneParseXML(virDomainNumaPtr numa, bool placement_static, size_t ncells, xmlXPathContextPtr ctxt) @@ -245,14 +244,14 @@ virDomainNumatuneParseXML(virDomainNumaPtr *numatunePtr, VIR_FREE(tmp); } - if (virDomainNumatuneSet(*numatunePtr, + if (virDomainNumatuneSet(numa, placement_static, placement, mode, nodeset) < 0) goto cleanup; - if (virDomainNumatuneNodeParseXML(numatunePtr, ncells, ctxt) < 0) + if (virDomainNumatuneNodeParseXML(numa, ncells, ctxt) < 0) goto cleanup; ret = 0; diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index 790f3bf..69eccf2 100644 --- a/src/conf/numa_conf.h +++ b/src/conf/numa_conf.h @@ -62,7 +62,7 @@ void virDomainNumaFree(virDomainNumaPtr numa); /* * XML Parse/Format functions */ -int virDomainNumatuneParseXML(virDomainNumaPtr *numatunePtr, +int virDomainNumatuneParseXML(virDomainNumaPtr numa, bool placement_static, size_t ncells, xmlXPathContextPtr ctxt) -- 2.2.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list