]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Clean up storageBackendCreateQemuImgCheckEncryption
authorJohn Ferlan <jferlan@redhat.com>
Wed, 20 Jun 2018 21:15:03 +0000 (17:15 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 26 Jun 2018 18:02:43 +0000 (14:02 -0400)
Remove the checks for qcow encryption since both callers (create
and resize) would have already disallowed usage.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
src/storage/storage_util.c

index 6b02bb2e9a97ebed1d77d878fb294a9c240e104b..fe588df7dd26eaae0dfbdaa570c4d7528449951b 100644 (file)
@@ -891,25 +891,7 @@ storageBackendCreateQemuImgCheckEncryption(int format,
 {
     virStorageEncryptionPtr enc = vol->target.encryption;
 
-    if (format == VIR_STORAGE_FILE_QCOW || format == VIR_STORAGE_FILE_QCOW2) {
-        if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_QCOW &&
-            enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_DEFAULT) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("unsupported volume encryption format %d"),
-                           vol->target.encryption->format);
-            return -1;
-        }
-        if (enc->nsecrets > 1) {
-            virReportError(VIR_ERR_XML_ERROR, "%s",
-                           _("too many secrets for qcow encryption"));
-            return -1;
-        }
-        if (enc->nsecrets == 0) {
-            virReportError(VIR_ERR_XML_ERROR, "%s",
-                           _("no secret provided for qcow encryption"));
-            return -1;
-        }
-    } else if (format == VIR_STORAGE_FILE_RAW) {
+    if (format == VIR_STORAGE_FILE_RAW) {
         if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("unsupported volume encryption format %d"),