mirror of https://gitee.com/openkylin/libvirt.git
util: sysinfo: Convert child buffers to use VIR_BUFFER_INIT_CHILD
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>
This commit is contained in:
parent
107f7a2d16
commit
186e247b4c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue