提交 a06c856d 编写于 作者: P Peter Krempa

conf: domain: Split up formatting of <memtune> and <memoryBacking>

Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 7596df34
...@@ -27985,6 +27985,17 @@ virDomainMemtuneFormat(virBufferPtr buf, ...@@ -27985,6 +27985,17 @@ virDomainMemtuneFormat(virBufferPtr buf,
virXMLFormatElement(buf, "memtune", NULL, &childBuf); virXMLFormatElement(buf, "memtune", NULL, &childBuf);
ret = 0;
return ret;
}
static void
virDomainMemorybackingFormat(virBufferPtr buf,
const virDomainMemtune *mem)
{
g_auto(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
virBufferSetChildIndent(&childBuf, buf); virBufferSetChildIndent(&childBuf, buf);
if (mem->nhugepages) if (mem->nhugepages)
...@@ -28006,9 +28017,6 @@ virDomainMemtuneFormat(virBufferPtr buf, ...@@ -28006,9 +28017,6 @@ virDomainMemtuneFormat(virBufferPtr buf,
virBufferAddLit(&childBuf, "<discard/>\n"); virBufferAddLit(&childBuf, "<discard/>\n");
virXMLFormatElement(buf, "memoryBacking", NULL, &childBuf); virXMLFormatElement(buf, "memoryBacking", NULL, &childBuf);
ret = 0;
return ret;
} }
...@@ -28484,6 +28492,8 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def, ...@@ -28484,6 +28492,8 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
if (virDomainMemtuneFormat(buf, &def->mem) < 0) if (virDomainMemtuneFormat(buf, &def->mem) < 0)
goto error; goto error;
virDomainMemorybackingFormat(buf, &def->mem);
if (virDomainCpuDefFormat(buf, def) < 0) if (virDomainCpuDefFormat(buf, def) < 0)
goto error; goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册