]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainDeviceDiskDefPostParseRestoreSecAlias: Hardcode restored aliases
authorPeter Krempa <pkrempa@redhat.com>
Fri, 6 Mar 2020 14:28:18 +0000 (15:28 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 Mar 2020 14:51:44 +0000 (15:51 +0100)
In order to be able to change the function generating the alias and thus
also the aliases itself, we must hardcode the old format for the case of
upgrading form libvirt which didn't record them in the status XML yet.

Note that this code path is tested by
'tests/qemustatusxml2xmldata/disk-secinfo-upgrade-in.xml'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c

index c8bd6f64478aba3139668d5457da7cb6ce14d46d..71ed809e4bc21be1e0642801efc01452e21ee6eb 100644 (file)
@@ -9031,16 +9031,14 @@ qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDefPtr disk,
     }
 
     if (restoreAuthSecret) {
-        if (!(authalias = qemuDomainGetSecretAESAlias(disk->info.alias, false)))
-            return -1;
+        authalias = g_strdup_printf("%s-secret0", disk->info.alias);
 
         if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->secinfo, &authalias) < 0)
             return -1;
     }
 
     if (restoreEncSecret) {
-        if (!(encalias = qemuDomainGetSecretAESAlias(disk->info.alias, true)))
-            return -1;
+        encalias = g_strdup_printf("%s-luks-secret0", disk->info.alias);
 
         if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->encinfo, &encalias) < 0)
             return -1;