return -1;
dest->data.tcp.haveTLS = src->data.tcp.haveTLS;
+ dest->data.tcp.tlsFromConfig = src->data.tcp.tlsFromConfig;
break;
case VIR_DOMAIN_CHR_TYPE_UNIX:
char *slave = NULL;
char *append = NULL;
char *haveTLS = NULL;
+ char *tlsFromConfig = NULL;
int remaining = 0;
while (cur != NULL) {
mode = virXMLPropString(cur, "mode");
if (!haveTLS)
haveTLS = virXMLPropString(cur, "tls");
+ if (!tlsFromConfig)
+ tlsFromConfig = virXMLPropString(cur, "tlsFromConfig");
switch ((virDomainChrType) def->type) {
case VIR_DOMAIN_CHR_TYPE_FILE:
goto error;
}
+ if (tlsFromConfig &&
+ flags & VIR_DOMAIN_DEF_PARSE_STATUS) {
+ int tmp;
+ if (virStrToLong_i(tlsFromConfig, NULL, 10, &tmp) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Invalid tlsFromConfig value: %s"),
+ tlsFromConfig);
+ goto error;
+ }
+ def->data.tcp.tlsFromConfig = !!tmp;
+ }
+
if (!protocol)
def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW;
else if ((def->data.tcp.protocol =
VIR_FREE(logappend);
VIR_FREE(logfile);
VIR_FREE(haveTLS);
+ VIR_FREE(tlsFromConfig);
return remaining;
def->data.tcp.listen ? "bind" : "connect");
virBufferEscapeString(buf, "host='%s' ", def->data.tcp.host);
virBufferEscapeString(buf, "service='%s'", def->data.tcp.service);
- if (def->data.tcp.haveTLS != VIR_TRISTATE_BOOL_ABSENT)
+ if (def->data.tcp.haveTLS != VIR_TRISTATE_BOOL_ABSENT &&
+ !(flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE &&
+ def->data.tcp.tlsFromConfig))
virBufferAsprintf(buf, " tls='%s'",
virTristateBoolTypeToString(def->data.tcp.haveTLS));
+ if (flags & VIR_DOMAIN_DEF_FORMAT_STATUS)
+ virBufferAsprintf(buf, " tlsFromConfig='%d'",
+ def->data.tcp.tlsFromConfig);
virBufferAddLit(buf, "/>\n");
virBufferAsprintf(buf, "<protocol type='%s'/>\n",