<a href="#elementsCharPTY">Pseudo TTY</a>
</li><li>
<a href="#elementsCharHost">Host device proxy</a>
+ </li><li>
+ <a href="#elementsCharPipe">Named pipe</a>
</li><li>
<a href="#elementsCharTCP">TCP client/server</a>
</li><li>
<source path="/dev/ttyS0"/>
<target port="1"/>
</serial>
+ ...</pre>
+ <h5>
+ <a name="elementsCharPipe" id="elementsCharPipe">Named pipe</a>
+ </h5>
+ <p>
+ The character device writes output to a named pipe. See pipe(7) for
+ more info.
+ </p>
+ <pre>
+ ...
+ <serial type="pipe">
+ <source path="/tmp/mypipe"/>
+ <target port="1"/>
+ </serial>
...</pre>
<h5>
<a name="elementsCharTCP" id="elementsCharTCP">TCP client/server</a>
...
<serial type="tcp">
<source mode="connect" host="0.0.0.0" service="2445"/>
- <wiremode type="telnet"/>
+ <protocol type="telnet"/>
<target port="1"/>
</serial>
...</pre>
</serial>
...</pre>
+ <h5><a name="elementsCharPipe">Named pipe</a></h5>
+
+ <p>
+ The character device writes output to a named pipe. See pipe(7) for
+ more info.
+ </p>
+
+ <pre>
+ ...
+ <serial type="pipe">
+ <source path="/tmp/mypipe"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
<h5><a name="elementsCharTCP">TCP client/server</a></h5>
<p>
...
<serial type="tcp">
<source mode="connect" host="0.0.0.0" service="2445"/>
- <wiremode type="telnet"/>
+ <protocol type="telnet"/>
<target port="1"/>
</serial>
...</pre>
* <serial type="tcp">
* <source mode="bind" host="0.0.0.0" service="2445"/>
* <target port="1"/>
+ * <protocol type='raw'/>
* </serial>
*
* <serial type="udp">
connectHost = virXMLPropString(cur, "host");
if (connectService == NULL)
connectService = virXMLPropString(cur, "service");
- } else {
+ } else if (STREQ((const char *)mode, "bind")) {
if (bindHost == NULL)
bindHost = virXMLPropString(cur, "host");
if (bindService == NULL)
bindService = virXMLPropString(cur, "service");
+ } else {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Unknown source mode '%s'"),
+ mode);
+ goto error;
}
if (def->type == VIR_DOMAIN_CHR_TYPE_UDP)
bindService = NULL;
def->data.tcp.listen = 1;
}
- if (protocol != NULL &&
- STREQ(protocol, "telnet"))
- def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
- else
+
+ if (protocol == NULL ||
+ STREQ(protocol, "raw"))
def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW;
+ else if (STREQ(protocol, "telnet"))
+ def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
+ else {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Unknown protocol '%s'"), protocol);
+ goto error;
+ }
+
break;
case VIR_DOMAIN_CHR_TYPE_UDP: