From: Peter Krempa Date: Fri, 25 Oct 2019 15:21:37 +0000 (+0200) Subject: conf: domain: Split up formatting of and X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a06c856d430f84c92d72c7637fd05fcb5a28f029;p=libvirt.git conf: domain: Split up formatting of and Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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;