[libvirt] [PATCH 03/12] storage_util: Remove unnecessary check

John Ferlan posted 12 patches 7 years ago
[libvirt] [PATCH 03/12] storage_util: Remove unnecessary check
Posted by John Ferlan 7 years ago
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 | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index cc1f6e7086..4dd73f2734 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -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 {
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 03/12] storage_util: Remove unnecessary check
Posted by Peter Krempa 6 years, 12 months ago
On Tue, May 08, 2018 at 08:47:56 -0400, John Ferlan wrote:
> 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 | 5 -----
>  1 file changed, 5 deletions(-)

ACK
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list