[libvirt] [PATCH 1/3] storage: Fix error path

John Ferlan jferlan at redhat.com
Tue Jul 19 18:27:40 UTC 2016


virStorageBackendCreateQemuImgCheckEncryption didn't return -1 if there
were no secrets.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/storage/storage_backend.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 430dccf..6aa5593 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -1063,6 +1063,7 @@ virStorageBackendCreateQemuImgCheckEncryption(int format,
         if (enc->nsecrets == 0) {
             virReportError(VIR_ERR_XML_ERROR, "%s",
                            _("no secret provided for luks encryption"));
+            return -1;
         }
     } else {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-- 
2.5.5




More information about the libvir-list mailing list