static int
qemuBuildChardevCommand(virCommand *cmd,
- virQEMUDriverConfig *cfg,
+ virQEMUDriverConfig *cfg G_GNUC_UNUSED,
const virDomainChrSourceDef *dev,
const char *charAlias,
virQEMUCaps *qemuCaps)
if (!(objalias = qemuAliasTLSObjFromSrcAlias(charAlias)))
return -1;
- if (qemuBuildTLSx509CommandLine(cmd, cfg->chardevTLSx509certdir,
+ if (qemuBuildTLSx509CommandLine(cmd, chrSourcePriv->tlsCertPath,
dev->data.tcp.listen,
- cfg->chardevTLSx509verify,
+ chrSourcePriv->tlsVerify,
tlsCertEncSecAlias,
objalias, qemuCaps) < 0) {
return -1;
VIR_FORCE_CLOSE(priv->fd);
VIR_FORCE_CLOSE(priv->logfd);
+ g_free(priv->tlsCertPath);
+
g_free(priv->fdset);
g_free(priv->logFdset);
g_free(priv->tlsCredsAlias);
charsrc->data.tcp.haveTLS = virTristateBoolFromBool(data->cfg->chardevTLS);
charsrc->data.tcp.tlsFromConfig = true;
}
+
+ if (charsrc->data.tcp.haveTLS == VIR_TRISTATE_BOOL_YES) {
+ charpriv->tlsCertPath = g_strdup(data->cfg->chardevTLSx509certdir);
+ charpriv->tlsVerify = data->cfg->chardevTLSx509verify;
+ }
}
break;
int logfd; /* file descriptor of the logging source */
bool wait; /* wait for incomming connections on chardev */
+ char *tlsCertPath; /* path to certificates if TLS is requested */
+ bool tlsVerify; /* whether server should verify client certificates */
+
char *fdset; /* fdset path corresponding to the passed filedescriptor */
char *logFdset; /* fdset path corresponding to the passed filedescriptor for logfile */
int passedFD; /* filedescriptor number when fdset passing it directly */