提交 619fac2e 编写于 作者: P Peter Krempa

conf: cpu: Convert child buffers to use VIR_BUFFER_INIT_CHILD

Use the new helper to initialize child XML element buffers.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 4a0ccab7
...@@ -683,7 +683,7 @@ virCPUDefFormatBufFull(virBufferPtr buf, ...@@ -683,7 +683,7 @@ virCPUDefFormatBufFull(virBufferPtr buf,
{ {
int ret = -1; int ret = -1;
virBuffer attributeBuf = VIR_BUFFER_INITIALIZER; virBuffer attributeBuf = VIR_BUFFER_INITIALIZER;
virBuffer childrenBuf = VIR_BUFFER_INITIALIZER; virBuffer childrenBuf = VIR_BUFFER_INIT_CHILD(buf);
if (!def) if (!def)
return 0; return 0;
...@@ -718,7 +718,6 @@ virCPUDefFormatBufFull(virBufferPtr buf, ...@@ -718,7 +718,6 @@ virCPUDefFormatBufFull(virBufferPtr buf,
} }
/* Format children */ /* Format children */
virBufferSetChildIndent(&childrenBuf, buf);
if (def->type == VIR_CPU_TYPE_HOST && def->arch) if (def->type == VIR_CPU_TYPE_HOST && def->arch)
virBufferAsprintf(&childrenBuf, "<arch>%s</arch>\n", virBufferAsprintf(&childrenBuf, "<arch>%s</arch>\n",
virArchToString(def->arch)); virArchToString(def->arch));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册