]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage_util: Remove luks distinction from secret path and alias
authorJohn Ferlan <jferlan@redhat.com>
Thu, 19 Apr 2018 14:52:03 +0000 (10:52 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 15 May 2018 20:57:24 +0000 (16:57 -0400)
Remove the "luks" distinction as the code is about to become more
generic and be able to support qcow encryption as well.

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

index d20a1093064d70ce7ae6965360238b0aebf22fbb..c72fd47024555f56313f335e5e8da398dc1e0475 100644 (file)
@@ -1216,7 +1216,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool,
 
     if (info.format == VIR_STORAGE_FILE_RAW && vol->target.encryption &&
         vol->target.encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
-        if (virAsprintf(&info.secretAlias, "%s_luks0", vol->name) < 0)
+        if (virAsprintf(&info.secretAlias, "%s_encrypt0", vol->name) < 0)
             goto error;
         if (storageBackendCreateQemuImgSecretObject(cmd, info.secretPath,
                                                     info.secretAlias) < 0)
@@ -1269,7 +1269,7 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,
 
     if ((fd = mkostemp(secretPath, O_CLOEXEC)) < 0) {
         virReportSystemError(errno, "%s",
-                             _("failed to open luks secret file for write"));
+                             _("failed to open secret file for write"));
         goto error;
     }
 
@@ -1280,7 +1280,7 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,
 
     if (safewrite(fd, secret, secretlen) < 0) {
         virReportSystemError(errno, "%s",
-                             _("failed to write luks secret file"));
+                             _("failed to write secret file"));
         goto error;
     }
     VIR_FORCE_CLOSE(fd);
@@ -1290,7 +1290,7 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,
         if (chown(secretPath, vol->target.perms->uid,
                   vol->target.perms->gid) < 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("failed to chown luks secret file"));
+                           _("failed to chown secret file"));
             goto error;
         }
     }
@@ -2331,7 +2331,7 @@ storageBackendResizeQemuImg(virStoragePoolObjPtr pool,
               storageBackendCreateQemuImgSecretPath(pool, vol)))
             goto cleanup;
 
-        if (virAsprintf(&secretAlias, "%s_luks0", vol->name) < 0)
+        if (virAsprintf(&secretAlias, "%s_encrypt0", vol->name) < 0)
             goto cleanup;
     }