提交 43a3d2e0 编写于 作者: P Peter Krempa

qemuDomainGetSecretAESAlias: Replace outstanding uses with qemuAliasForSecret

There are two last callers of this function. Replace them by
qemuAliasForSecret and delete qemuDomainGetSecretAESAlias.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 70d2758a
......@@ -764,35 +764,6 @@ qemuDomainGetMasterKeyAlias(void)
}
/* qemuDomainGetSecretAESAlias:
* @srcalias: Source alias used to generate the secret alias
* @isLuks: True when we are generating a secret for LUKS encrypt/decrypt
*
* Generate and return an alias for the encrypted secret
*
* Returns NULL or a string containing the alias
*/
char *
qemuDomainGetSecretAESAlias(const char *srcalias,
bool isLuks)
{
char *alias;
if (!srcalias) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("encrypted secret alias requires valid source alias"));
return NULL;
}
if (isLuks)
alias = g_strdup_printf("%s-luks-secret0", srcalias);
else
alias = g_strdup_printf("%s-secret0", srcalias);
return alias;
}
/* qemuAliasForSecret:
* @parentalias: alias of the parent object
* @obj: optional sub-object of the parent device the secret is for
......
......@@ -83,9 +83,6 @@ char *qemuAliasFromHostdev(const virDomainHostdevDef *hostdev);
char *qemuDomainGetMasterKeyAlias(void);
char *qemuDomainGetSecretAESAlias(const char *srcalias,
bool isLuks);
char *qemuAliasForSecret(const char *parentalias,
const char *obj);
......
......@@ -1842,7 +1842,7 @@ qemuDomainDelChardevTLSObjects(virQEMUDriverPtr driver,
* secret UUID and we have a serial TCP chardev, then formulate a
* secAlias which we'll attempt to destroy. */
if (cfg->chardevTLSx509secretUUID &&
!(secAlias = qemuDomainGetSecretAESAlias(inAlias, false)))
!(secAlias = qemuAliasForSecret(inAlias, NULL)))
return -1;
qemuDomainObjEnterMonitor(driver, vm);
......
......@@ -1080,7 +1080,7 @@ qemuMigrationParamsResetTLS(virQEMUDriverPtr driver,
return;
tlsAlias = qemuAliasTLSObjFromSrcAlias(QEMU_MIGRATION_TLS_ALIAS_BASE);
secAlias = qemuDomainGetSecretAESAlias(QEMU_MIGRATION_TLS_ALIAS_BASE, false);
secAlias = qemuAliasForSecret(QEMU_MIGRATION_TLS_ALIAS_BASE, NULL);
qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, tlsAlias);
g_clear_pointer(&QEMU_DOMAIN_PRIVATE(vm)->migSecinfo, qemuDomainSecretInfoFree);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册