]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage_util: Remove unnecessary check
authorJohn Ferlan <jferlan@redhat.com>
Wed, 18 Apr 2018 16:43:43 +0000 (12:43 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 15 May 2018 20:54:58 +0000 (16:54 -0400)
Commit id 'a48c71411' altered the logic a bit and didn't
remove an unnecessary check as info.encryption is true when
vol->target.encryption != NULL, so if we enter the if segment
with info.format == VIR_STORAGE_FILE_RAW && vol->target.encryption
!= NULL, then there's no way info.encryption could be false.

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

index cc1f6e70863aefa906cb060a7e341d5cfe1e0108..4dd73f27342b8da61299e2f3ce1ccc4b2bec7380 100644 (file)
@@ -1175,11 +1175,6 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
                            _("cannot use inputvol with encrypted raw volume"));
             return NULL;
         }
-        if (!info.encryption) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("missing encryption description"));
-            return NULL;
-        }
         if (vol->target.encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
             type = "luks";
         } else {