diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index d86ac99a67..9b48fb87ea 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -278,11 +278,22 @@ virDomainNumatuneFormatXML(virBufferPtr buf, { const char *tmp = NULL; char *nodeset = NULL; + bool nodesetSpecified = false; size_t i = 0; if (!numatune) return 0; + for (i = 0; i < numatune->nmem_nodes; i++) { + if (numatune->mem_nodes[i].nodeset) { + nodesetSpecified = true; + break; + } + } + + if (!nodesetSpecified && !numatune->memory.specified) + return 0; + virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2);