Blob Blame History Raw
From 41651c5fbe6712dcca09cfc875af4d16c0f9fd68 Mon Sep 17 00:00:00 2001
Message-Id: <41651c5fbe6712dcca09cfc875af4d16c0f9fd68@dist-git>
From: John Ferlan <jferlan@redhat.com>
Date: Wed, 3 Apr 2019 07:35:45 -0400
Subject: [PATCH] storage: Remove secretPath from _virStorageBackendQemuImgInfo

https://bugzilla.redhat.com/show_bug.cgi?id=1613737

There's really no need for it to be there since it's only ever
used inside virStorageBackendCreateQemuImgCmdFromVol

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit f6aa977fab1108e652ab8c360a651045c727d02e)
Message-Id: <20190403113547.29231-2-jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
---
 src/storage/storage_util.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 19e6e0544b..54e778490d 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -709,7 +709,6 @@ struct _virStorageBackendQemuImgInfo {
     int inputFormat;
 
     char *secretAlias;
-    const char *secretPath;
 };
 
 
@@ -1081,7 +1080,6 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
         .compat = vol->target.compat,
         .features = vol->target.features,
         .nocow = vol->target.nocow,
-        .secretPath = secretPath,
         .secretAlias = NULL,
     };
     virStorageEncryptionPtr enc = vol->target.encryption;
@@ -1124,14 +1122,14 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
         virCommandAddArgList(cmd, "-b", info.backingPath, NULL);
 
     if (enc) {
-        if (!info.secretPath) {
+        if (!secretPath) {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("path to secret data file is required"));
             goto error;
         }
         if (virAsprintf(&info.secretAlias, "%s_encrypt0", vol->name) < 0)
             goto error;
-        if (storageBackendCreateQemuImgSecretObject(cmd, info.secretPath,
+        if (storageBackendCreateQemuImgSecretObject(cmd, secretPath,
                                                     info.secretAlias) < 0)
             goto error;
         encinfo = &enc->encinfo;
-- 
2.21.0