mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
conf: numa: Format <numatune> XML only if necessary
Do a content-aware check if formatting of the <numatune> element is necessary. Later on the def->numa structure will be always present so we cannot decide only on the basis whether it's allocated.
This commit is contained in:
parent
638e3d270f
commit
121cde4726
@ -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, "<numatune>\n");
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user