]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: storagefile: Remove cleanup label from virStorageSourceParseBackingJSONiSCSI
authorPeter Krempa <pkrempa@redhat.com>
Thu, 15 Aug 2019 13:54:04 +0000 (15:54 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 26 Aug 2019 11:49:16 +0000 (13:49 +0200)
There is no cleanup code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virstoragefile.c

index 0b68adeb1d31c689f527dacc16af4679b4b98f5b..2c9628c71eaf68c583053a01498710d0574ba804 100644 (file)
@@ -3265,7 +3265,6 @@ virStorageSourceParseBackingJSONiSCSI(virStorageSourcePtr src,
     const char *lun = virJSONValueObjectGetStringOrNumber(json, "lun");
     const char *uri;
     char *port;
-    int ret = -1;
 
     /* legacy URI based syntax passed via 'filename' option */
     if ((uri = virJSONValueObjectGetString(json, "filename")))
@@ -3279,14 +3278,14 @@ virStorageSourceParseBackingJSONiSCSI(virStorageSourcePtr src,
         lun = "0";
 
     if (VIR_ALLOC(src->hosts) < 0)
-        goto cleanup;
+        return -1;
 
     src->nhosts = 1;
 
     if (STRNEQ_NULLABLE(transport, "tcp")) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
                        _("only TCP transport is supported for iSCSI volumes"));
-        goto cleanup;
+        return -1;
     }
 
     src->hosts->transport = VIR_STORAGE_NET_HOST_TRANS_TCP;
@@ -3294,33 +3293,30 @@ virStorageSourceParseBackingJSONiSCSI(virStorageSourcePtr src,
     if (!portal) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
                        _("missing 'portal' address in iSCSI backing definition"));
-        goto cleanup;
+        return -1;
     }
 
     if (!target) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
                        _("missing 'target' in iSCSI backing definition"));
-        goto cleanup;
+        return -1;
     }
 
     if (VIR_STRDUP(src->hosts->name, portal) < 0)
-        goto cleanup;
+        return -1;
 
     if ((port = strrchr(src->hosts->name, ':')) &&
         !strchr(port, ']')) {
         if (virStringParsePort(port + 1, &src->hosts->port) < 0)
-            goto cleanup;
+            return -1;
 
         *port = '\0';
     }
 
     if (virAsprintf(&src->path, "%s/%s", target, lun) < 0)
-        goto cleanup;
-
-    ret = 0;
+        return -1;
 
- cleanup:
-    return ret;
+    return 0;
 }