There are two last callers of this function. Replace them by qemuAliasForSecret and delete qemuDomainGetSecretAESAlias. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_alias.c | 29 ----------------------------- src/qemu/qemu_alias.h | 3 --- src/qemu/qemu_hotplug.c | 2 +- src/qemu/qemu_migration_params.c | 2 +- 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index 2e466ff23f..b450bf0866 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -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 diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h index 645956d024..490aa568a9 100644 --- a/src/qemu/qemu_alias.h +++ b/src/qemu/qemu_alias.h @@ -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); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index e804053933..47069be900 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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); diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c index f9bc43afee..6a2033b484 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -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); -- 2.24.1