[libvirt] [PATCH 08/14] util: storagefile: Preserve return value in virStorageSourceParseBackingJSONUriStr

Peter Krempa pkrempa at redhat.com
Fri Aug 16 10:39:29 UTC 2019


virStorageSourceParseBackingURI will report special return values in
some cases. Preserve it in virStorageSourceParseBackingJSONUriStr.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/util/virstoragefile.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 4e57a0438e..192a79c025 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -3073,7 +3073,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) {
@@ -3085,7 +3087,7 @@ virStorageSourceParseBackingJSONUriStr(virStorageSourcePtr src,
         return -1;
     }

-    return 0;
+    return rc;
 }


-- 
2.21.0




More information about the libvir-list mailing list