提交 95a8c433 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 b05322fc
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册