[libvirt] [PATCH 02/10] util: storage: Add missing return to virStorageSourceParseBackingJSONGluster

Peter Krempa pkrempa at redhat.com
Fri Jun 16 15:29:39 UTC 2017


If the number of servers is not expected the code would report an error
but would not return failure.
---
 src/util/virstoragefile.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 020c69def..6b0af521f 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2888,6 +2888,8 @@ virStorageSourceParseBackingJSONGluster(virStorageSourcePtr src,
         virReportError(VIR_ERR_INVALID_ARG, "%s",
                        _("at least 1 server is necessary in "
                          "JSON backing definition for gluster volume"));
+
+        return -1;
     }

     if (VIR_ALLOC_N(src->hosts, nservers) < 0)
-- 
2.12.2




More information about the libvir-list mailing list