conf: cpu: 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:
Peter Krempa 2019-10-30 12:40:06 +01:00
parent 4a0ccab772
commit 619fac2ea6

View File

@ -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));