[PATCH 9/9] virCPUDefFormatBufFull: Use virXMLFormatElement

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

 



The function was basically open-coding it.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/cpu_conf.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 7778e01131..5cf7716b12 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -743,21 +743,7 @@ virCPUDefFormatBufFull(virBufferPtr buf,
     if (virDomainNumaDefFormatXML(&childrenBuf, numa) < 0)
         return -1;

-    /* Put it all together */
-    if (virBufferUse(&attributeBuf) || virBufferUse(&childrenBuf)) {
-        virBufferAddLit(buf, "<cpu");
-
-        if (virBufferUse(&attributeBuf))
-            virBufferAddBuffer(buf, &attributeBuf);
-
-        if (virBufferUse(&childrenBuf)) {
-            virBufferAddLit(buf, ">\n");
-            virBufferAddBuffer(buf, &childrenBuf);
-            virBufferAddLit(buf, "</cpu>\n");
-        } else {
-            virBufferAddLit(buf, "/>\n");
-        }
-    }
+    virXMLFormatElement(buf, "cpu", &attributeBuf, &childrenBuf);

     return 0;
 }
-- 
2.26.2




[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