提交 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, ...@@ -609,17 +609,17 @@ qemuDomainGetSecretAESAlias(const char *srcalias,
} }
/* qemuAliasTLSObjFromChardevAlias /* qemuAliasTLSObjFromSrcAlias
* @chardev_alias: Pointer to the chardev alias string * @srcAlias: Pointer to a source alias string
* *
* Generate and return a string to be used as the TLS object alias * Generate and return a string to be used as the TLS object alias
*/ */
char * char *
qemuAliasTLSObjFromChardevAlias(const char *chardev_alias) qemuAliasTLSObjFromSrcAlias(const char *srcAlias)
{ {
char *ret; char *ret;
ignore_value(virAsprintf(&ret, "obj%s_tls0", chardev_alias)); ignore_value(virAsprintf(&ret, "obj%s_tls0", srcAlias));
return ret; return ret;
} }
......
...@@ -81,7 +81,7 @@ char *qemuDomainGetMasterKeyAlias(void); ...@@ -81,7 +81,7 @@ char *qemuDomainGetMasterKeyAlias(void);
char *qemuDomainGetSecretAESAlias(const char *srcalias, char *qemuDomainGetSecretAESAlias(const char *srcalias,
bool isLuks); bool isLuks);
char *qemuAliasTLSObjFromChardevAlias(const char *chardev_alias) char *qemuAliasTLSObjFromSrcAlias(const char *srcAlias)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
char *qemuAliasChardevFromDevAlias(const char *devAlias) char *qemuAliasChardevFromDevAlias(const char *devAlias)
......
...@@ -782,7 +782,7 @@ qemuBuildTLSx509CommandLine(virCommandPtr cmd, ...@@ -782,7 +782,7 @@ qemuBuildTLSx509CommandLine(virCommandPtr cmd,
qemuCaps, &props) < 0) qemuCaps, &props) < 0)
goto cleanup; goto cleanup;
if (!(objalias = qemuAliasTLSObjFromChardevAlias(inalias))) if (!(objalias = qemuAliasTLSObjFromSrcAlias(inalias)))
goto cleanup; goto cleanup;
if (!(tmp = virQEMUBuildObjectCommandlineFromJSON("tls-creds-x509", if (!(tmp = virQEMUBuildObjectCommandlineFromJSON("tls-creds-x509",
...@@ -4988,7 +4988,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, ...@@ -4988,7 +4988,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
charAlias, qemuCaps) < 0) charAlias, qemuCaps) < 0)
goto cleanup; goto cleanup;
if (!(objalias = qemuAliasTLSObjFromChardevAlias(charAlias))) if (!(objalias = qemuAliasTLSObjFromSrcAlias(charAlias)))
goto cleanup; goto cleanup;
virBufferAsprintf(&buf, ",tls-creds=%s", objalias); virBufferAsprintf(&buf, ",tls-creds=%s", objalias);
VIR_FREE(objalias); VIR_FREE(objalias);
......
...@@ -1561,7 +1561,7 @@ qemuDomainGetChardevTLSObjects(virQEMUDriverConfigPtr cfg, ...@@ -1561,7 +1561,7 @@ qemuDomainGetChardevTLSObjects(virQEMUDriverConfigPtr cfg,
tlsProps) < 0) tlsProps) < 0)
return -1; return -1;
if (!(*tlsAlias = qemuAliasTLSObjFromChardevAlias(charAlias))) if (!(*tlsAlias = qemuAliasTLSObjFromSrcAlias(charAlias)))
return -1; return -1;
dev->data.tcp.tlscreds = true; dev->data.tcp.tlscreds = true;
...@@ -4016,7 +4016,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver, ...@@ -4016,7 +4016,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
if (chr->source->type == VIR_DOMAIN_CHR_TYPE_TCP && if (chr->source->type == VIR_DOMAIN_CHR_TYPE_TCP &&
chr->source->data.tcp.haveTLS == VIR_TRISTATE_BOOL_YES) { chr->source->data.tcp.haveTLS == VIR_TRISTATE_BOOL_YES) {
if (!(tlsAlias = qemuAliasTLSObjFromChardevAlias(charAlias))) if (!(tlsAlias = qemuAliasTLSObjFromSrcAlias(charAlias)))
goto cleanup; goto cleanup;
/* Best shot at this as the secinfo is destroyed after process launch /* Best shot at this as the secinfo is destroyed after process launch
...@@ -4095,7 +4095,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver, ...@@ -4095,7 +4095,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
goto cleanup; goto cleanup;
if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD) { if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD) {
if (!(tlsAlias = qemuAliasTLSObjFromChardevAlias(charAlias))) if (!(tlsAlias = qemuAliasTLSObjFromSrcAlias(charAlias)))
goto cleanup; goto cleanup;
/* Best shot at this as the secinfo is destroyed after process launch /* Best shot at this as the secinfo is destroyed after process launch
......
...@@ -6303,7 +6303,7 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID, ...@@ -6303,7 +6303,7 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
virJSONValueObjectAppendBoolean(data, "server", chr->data.tcp.listen) < 0) virJSONValueObjectAppendBoolean(data, "server", chr->data.tcp.listen) < 0)
goto error; goto error;
if (chr->data.tcp.tlscreds) { if (chr->data.tcp.tlscreds) {
if (!(tlsalias = qemuAliasTLSObjFromChardevAlias(chrID))) if (!(tlsalias = qemuAliasTLSObjFromSrcAlias(chrID)))
goto error; goto error;
if (virJSONValueObjectAppendString(data, "tls-creds", tlsalias) < 0) if (virJSONValueObjectAppendString(data, "tls-creds", tlsalias) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册