mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 22:45:17 +00:00
conf: Simplify control flow in virDomainDiskSourceFormat
Now that the cleanup is handled automatically it can be removed. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
4bc429868e
commit
eaef9b1f67
@ -23797,12 +23797,11 @@ virDomainDiskSourceFormat(virBufferPtr buf,
|
|||||||
{
|
{
|
||||||
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||||
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
VIR_AUTOCLEAN(virBuffer) childBuf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
virBufferSetChildIndent(&childBuf, buf);
|
virBufferSetChildIndent(&childBuf, buf);
|
||||||
|
|
||||||
if (virDomainStorageSourceFormat(&attrBuf, &childBuf, src, flags) < 0)
|
if (virDomainStorageSourceFormat(&attrBuf, &childBuf, src, flags) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (policy && src->type != VIR_STORAGE_TYPE_NETWORK)
|
if (policy && src->type != VIR_STORAGE_TYPE_NETWORK)
|
||||||
virBufferEscapeString(&attrBuf, " startupPolicy='%s'",
|
virBufferEscapeString(&attrBuf, " startupPolicy='%s'",
|
||||||
@ -23812,15 +23811,12 @@ virDomainDiskSourceFormat(virBufferPtr buf,
|
|||||||
virBufferAsprintf(&attrBuf, " index='%u'", src->id);
|
virBufferAsprintf(&attrBuf, " index='%u'", src->id);
|
||||||
|
|
||||||
if (virDomainDiskSourceFormatPrivateData(&childBuf, src, flags, xmlopt) < 0)
|
if (virDomainDiskSourceFormatPrivateData(&childBuf, src, flags, xmlopt) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (virXMLFormatElement(buf, "source", &attrBuf, &childBuf) < 0)
|
if (virXMLFormatElement(buf, "source", &attrBuf, &childBuf) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user