[libvirt] [PATCH 5/7] conf: cpu: Convert child buffers to use VIR_BUFFER_INIT_CHILD

Peter Krempa pkrempa at redhat.com
Tue Nov 12 14:18:18 UTC 2019


Use the new helper to initialize child XML element buffers.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/conf/cpu_conf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 2b644638a7..ca048d899a 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -683,7 +683,7 @@ virCPUDefFormatBufFull(virBufferPtr buf,
 {
     int ret = -1;
     virBuffer attributeBuf = VIR_BUFFER_INITIALIZER;
-    virBuffer childrenBuf = VIR_BUFFER_INITIALIZER;
+    virBuffer childrenBuf = VIR_BUFFER_INIT_CHILD(buf);

     if (!def)
         return 0;
@@ -718,7 +718,6 @@ virCPUDefFormatBufFull(virBufferPtr buf,
     }

     /* Format children */
-    virBufferSetChildIndent(&childrenBuf, buf);
     if (def->type == VIR_CPU_TYPE_HOST && def->arch)
         virBufferAsprintf(&childrenBuf, "<arch>%s</arch>\n",
                           virArchToString(def->arch));
-- 
2.23.0




More information about the libvir-list mailing list