mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
qemu: Rename qemuAliasTLSObjFromChardevAlias
It's not really 'Chardev' specific - we can reuse this for other objects. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
82ddd0b155
commit
75ba06e44a
@ -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);
|
|||||||
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,
|
|||||||
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,
|
|||||||
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,
|
|||||||
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,
|
|||||||
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,
|
|||||||
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,
|
|||||||
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user