It's not really 'Chardev' specific - we can reuse this for other objects.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/qemu/qemu_alias.c | 8 ++++----
src/qemu/qemu_alias.h | 2 +-
src/qemu/qemu_command.c | 4 ++--
src/qemu/qemu_hotplug.c | 6 +++---
src/qemu/qemu_monitor_json.c | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c
index 8521a44..4cccf23 100644
--- a/src/qemu/qemu_alias.c
+++ b/src/qemu/qemu_alias.c
@@ -609,17 +609,17 @@ qemuDomainGetSecretAESAlias(const char *srcalias,
}
-/* qemuAliasTLSObjFromChardevAlias
- * @chardev_alias: Pointer to the chardev alias string
+/* qemuAliasTLSObjFromSrcAlias
+ * @srcAlias: Pointer to a source alias string
*
* Generate and return a string to be used as the TLS object alias
*/
char *
-qemuAliasTLSObjFromChardevAlias(const char *chardev_alias)
+qemuAliasTLSObjFromSrcAlias(const char *srcAlias)
{
char *ret;
- ignore_value(virAsprintf(&ret, "obj%s_tls0", chardev_alias));
+ ignore_value(virAsprintf(&ret, "obj%s_tls0", srcAlias));
return ret;
}
diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h
index dea05cf..300fd4d 100644
--- a/src/qemu/qemu_alias.h
+++ b/src/qemu/qemu_alias.h
@@ -81,7 +81,7 @@ char *qemuDomainGetMasterKeyAlias(void);
char *qemuDomainGetSecretAESAlias(const char *srcalias,
bool isLuks);
-char *qemuAliasTLSObjFromChardevAlias(const char *chardev_alias)
+char *qemuAliasTLSObjFromSrcAlias(const char *srcAlias)
ATTRIBUTE_NONNULL(1);
char *qemuAliasChardevFromDevAlias(const char *devAlias)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c00a47a..d831d56 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -782,7 +782,7 @@ qemuBuildTLSx509CommandLine(virCommandPtr cmd,
qemuCaps, &props) < 0)
goto cleanup;
- if (!(objalias = qemuAliasTLSObjFromChardevAlias(inalias)))
+ if (!(objalias = qemuAliasTLSObjFromSrcAlias(inalias)))
goto cleanup;
if (!(tmp = virQEMUBuildObjectCommandlineFromJSON("tls-creds-x509",
@@ -5098,7 +5098,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
charAlias, qemuCaps) < 0)
goto cleanup;
- if (!(objalias = qemuAliasTLSObjFromChardevAlias(charAlias)))
+ if (!(objalias = qemuAliasTLSObjFromSrcAlias(charAlias)))
goto cleanup;
virBufferAsprintf(&buf, ",tls-creds=%s", objalias);
VIR_FREE(objalias);
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 2f209f1..8d15eee 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1561,7 +1561,7 @@ qemuDomainGetChardevTLSObjects(virQEMUDriverConfigPtr cfg,
tlsProps) < 0)
return -1;
- if (!(*tlsAlias = qemuAliasTLSObjFromChardevAlias(charAlias)))
+ if (!(*tlsAlias = qemuAliasTLSObjFromSrcAlias(charAlias)))
return -1;
dev->data.tcp.tlscreds = true;
@@ -4016,7 +4016,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
if (chr->source->type == VIR_DOMAIN_CHR_TYPE_TCP &&
chr->source->data.tcp.haveTLS == VIR_TRISTATE_BOOL_YES) {
- if (!(tlsAlias = qemuAliasTLSObjFromChardevAlias(charAlias)))
+ if (!(tlsAlias = qemuAliasTLSObjFromSrcAlias(charAlias)))
goto cleanup;
/* Best shot at this as the secinfo is destroyed after process launch
@@ -4095,7 +4095,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
goto cleanup;
if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD) {
- if (!(tlsAlias = qemuAliasTLSObjFromChardevAlias(charAlias)))
+ if (!(tlsAlias = qemuAliasTLSObjFromSrcAlias(charAlias)))
goto cleanup;
/* Best shot at this as the secinfo is destroyed after process launch
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 1d281af..7aa9e31 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6303,7 +6303,7 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
virJSONValueObjectAppendBoolean(data, "server",
chr->data.tcp.listen) < 0)
goto error;
if (chr->data.tcp.tlscreds) {
- if (!(tlsalias = qemuAliasTLSObjFromChardevAlias(chrID)))
+ if (!(tlsalias = qemuAliasTLSObjFromSrcAlias(chrID)))
goto error;
if (virJSONValueObjectAppendString(data, "tls-creds", tlsalias)
< 0)
--
2.9.3