[PATCH 07/10] conf: domain: Split up formatting of <memtune> and <memoryBacking>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 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, "<discard/>\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;

-- 
2.23.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux