[PATCH 14/34] cleanup error path in virDomainStorageSourceParse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/conf/domain_conf.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 0c650ffc2c..ef164f3375 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9070,7 +9070,6 @@ virDomainStorageSourceParse(xmlNodePtr node,
                             virStorageSourcePtr src,
                             unsigned int flags)
 {
-    int ret = -1;
     VIR_XPATH_NODE_AUTORESTORE(ctxt);
     xmlNodePtr tmp;

@@ -9088,34 +9087,34 @@ virDomainStorageSourceParse(xmlNodePtr node,
         break;
     case VIR_STORAGE_TYPE_NETWORK:
         if (virDomainDiskSourceNetworkParse(node, ctxt, src, flags) < 0)
-            goto cleanup;
+            return -1;
         break;
     case VIR_STORAGE_TYPE_VOLUME:
         if (virDomainDiskSourcePoolDefParse(node, &src->srcpool) < 0)
-            goto cleanup;
+            return -1;
         break;
     case VIR_STORAGE_TYPE_NONE:
     case VIR_STORAGE_TYPE_LAST:
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("unexpected disk type %s"),
                        virStorageTypeToString(src->type));
-        goto cleanup;
+        return -1;
     }

     if ((tmp = virXPathNode("./auth", ctxt)) &&
         !(src->auth = virStorageAuthDefParse(tmp, ctxt)))
-        goto cleanup;
+        return -1;

     if ((tmp = virXPathNode("./encryption", ctxt)) &&
         !(src->encryption = virStorageEncryptionParseNode(tmp, ctxt)))
-        goto cleanup;
+        return -1;

     if (virDomainDiskSourcePRParse(node, ctxt, &src->pr) < 0)
-        goto cleanup;
+        return -1;

     if (virSecurityDeviceLabelDefParseXML(&src->seclabels, &src->nseclabels,
                                           ctxt, flags) < 0)
-        goto cleanup;
+        return -1;

     /* People sometimes pass a bogus '' source path when they mean to omit the
      * source element completely (e.g. CDROM without media). This is just a
@@ -9123,10 +9122,7 @@ virDomainStorageSourceParse(xmlNodePtr node,
     if (src->path && !*src->path)
         VIR_FREE(src->path);

-    ret = 0;
-
- cleanup:
-    return ret;
+    return 0;
 }


-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux