]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Simplify control flow in virDomainDiskSourceFormat
authorPeter Krempa <pkrempa@redhat.com>
Thu, 7 Mar 2019 16:35:04 +0000 (17:35 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 3 Apr 2019 09:58:09 +0000 (11:58 +0200)
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>
src/conf/domain_conf.c

index 3770a82fa3fb42a96b225c23a267a9b0605cc9b6..bbcc618001485d3f21a0d44a684e5a549264e84d 100644 (file)
@@ -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;
 }