mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
qemuDomainDeviceDiskDefPostParseRestoreSecAlias: Hardcode restored aliases
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>
This commit is contained in:
parent
b05322fc03
commit
95a8c4332d
@ -9031,16 +9031,14 @@ qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDefPtr disk,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (restoreAuthSecret) {
|
if (restoreAuthSecret) {
|
||||||
if (!(authalias = qemuDomainGetSecretAESAlias(disk->info.alias, false)))
|
authalias = g_strdup_printf("%s-secret0", disk->info.alias);
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->secinfo, &authalias) < 0)
|
if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->secinfo, &authalias) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (restoreEncSecret) {
|
if (restoreEncSecret) {
|
||||||
if (!(encalias = qemuDomainGetSecretAESAlias(disk->info.alias, true)))
|
encalias = g_strdup_printf("%s-luks-secret0", disk->info.alias);
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->encinfo, &encalias) < 0)
|
if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->encinfo, &encalias) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user