提交 75ba06e4 编写于 作者: J John Ferlan

qemu: Rename qemuAliasTLSObjFromChardevAlias

It's not really 'Chardev' specific - we can reuse this for other objects.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 82ddd0b1
......@@ -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;
}
......
......@@ -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)
......
......@@ -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",
......@@ -4988,7 +4988,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);
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册