提交 eaef9b1f 编写于 作者: P Peter Krempa

conf: Simplify control flow in virDomainDiskSourceFormat

Now that the cleanup is handled automatically it can be removed.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 4bc42986
......@@ -23797,12 +23797,11 @@ virDomainDiskSourceFormat(virBufferPtr buf,
{
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
int ret = -1;
virBufferSetChildIndent(&childBuf, buf);
if (virDomainStorageSourceFormat(&attrBuf, &childBuf, src, flags) < 0)
goto cleanup;
return -1;
if (policy && src->type != VIR_STORAGE_TYPE_NETWORK)
virBufferEscapeString(&attrBuf, " startupPolicy='%s'",
......@@ -23812,15 +23811,12 @@ virDomainDiskSourceFormat(virBufferPtr buf,
virBufferAsprintf(&attrBuf, " index='%u'", src->id);
if (virDomainDiskSourceFormatPrivateData(&childBuf, src, flags, xmlopt) < 0)
goto cleanup;
return -1;
if (virXMLFormatElement(buf, "source", &attrBuf, &childBuf) < 0)
goto cleanup;
ret = 0;
return -1;
cleanup:
return ret;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册