]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: storagefile: Preserve return value in virStorageSourceParseBackingJSONUriStr
authorPeter Krempa <pkrempa@redhat.com>
Thu, 15 Aug 2019 14:21:55 +0000 (16:21 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 26 Aug 2019 11:49:17 +0000 (13:49 +0200)
virStorageSourceParseBackingURI will report special return values in
some cases. Preserve it in virStorageSourceParseBackingJSONUriStr.

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

index 5e02ea7bf53187f20a6bf6e017d8503f628330ed..56e7e5fc9e98baa6cd6c48929d4bd0ee16cce2b8 100644 (file)
@@ -3075,7 +3075,9 @@ virStorageSourceParseBackingJSONUriStr(virStorageSourcePtr src,
                                        const char *uri,
                                        int protocol)
 {
-    if (virStorageSourceParseBackingURI(src, uri) < 0)
+    int rc;
+
+    if ((rc = virStorageSourceParseBackingURI(src, uri)) < 0)
         return -1;
 
     if (src->protocol != protocol) {
@@ -3087,7 +3089,7 @@ virStorageSourceParseBackingJSONUriStr(virStorageSourcePtr src,
         return -1;
     }
 
-    return 0;
+    return rc;
 }