]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: sysinfo: Convert child buffers to use VIR_BUFFER_INIT_CHILD
authorPeter Krempa <pkrempa@redhat.com>
Wed, 30 Oct 2019 11:40:06 +0000 (12:40 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 13 Nov 2019 08:10:30 +0000 (09:10 +0100)
Use the new helper to initialize child XML element buffers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virsysinfo.c

index 9d013067fe8ce0712458c247ee51dff0f7b58dc5..d656b23731a8a5e1ba81d7827e0f9f0f117f9250 100644 (file)
@@ -1482,7 +1482,7 @@ int
 virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def)
 {
     virBuffer attrBuf = VIR_BUFFER_INITIALIZER;
-    virBuffer childrenBuf = VIR_BUFFER_INITIALIZER;
+    virBuffer childrenBuf = VIR_BUFFER_INIT_CHILD(buf);
     const char *type = virSysinfoTypeToString(def->type);
 
     if (!type) {
@@ -1493,8 +1493,6 @@ virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def)
         return -1;
     }
 
-    virBufferSetChildIndent(&childrenBuf, buf);
-
     virSysinfoBIOSFormat(&childrenBuf, def->bios);
     virSysinfoSystemFormat(&childrenBuf, def->system);
     virSysinfoBaseBoardFormat(&childrenBuf, def->baseBoard, def->nbaseBoard);