render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From 6146c60df8ac981e06828ca13d1f935af866028a Mon Sep 17 00:00:00 2001
Message-Id: <6146c60df8ac981e06828ca13d1f935af866028a@dist-git>
From: John Ferlan <jferlan@redhat.com>
Date: Fri, 2 Nov 2018 16:57:10 +0100
Subject: [PATCH] storage: Remove secretPath from _virStorageBackendQemuImgInfo

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)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@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 5dc22d3182..19e58714ca 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.19.1