From a06c856d430f84c92d72c7637fd05fcb5a28f029 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 25 Oct 2019 17:21:37 +0200 Subject: [PATCH] conf: domain: Split up formatting of and MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3e81140430..0e774889a2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27985,6 +27985,17 @@ virDomainMemtuneFormat(virBufferPtr buf, 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); if (mem->nhugepages) @@ -28006,9 +28017,6 @@ virDomainMemtuneFormat(virBufferPtr buf, virBufferAddLit(&childBuf, "\n"); virXMLFormatElement(buf, "memoryBacking", NULL, &childBuf); - - ret = 0; - return ret; } @@ -28484,6 +28492,8 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def, if (virDomainMemtuneFormat(buf, &def->mem) < 0) goto error; + virDomainMemorybackingFormat(buf, &def->mem); + if (virDomainCpuDefFormat(buf, def) < 0) goto error;