devicechar: Support source_master and source_slave

Needed for type=nvdm for *bsd

https://bugzilla.redhat.com/show_bug.cgi?id=1369803
This commit is contained in:
Cole Robinson 2016-08-24 16:37:36 -04:00
parent 4c759ad23d
commit c84c2cfd58
5 changed files with 14 additions and 0 deletions

View File

@ -246,6 +246,9 @@
<protocol type="telnet"/>
<log file="/tmp/foo.log" append="on"/>
</serial>
<serial type="nmdm">
<source master="/dev/foo1" slave="/dev/foo2"/>
</serial>
<parallel type="udp">
<source mode="bind" host="127.0.0.1" service="1234"/>
<source mode="connect" host="0.0.0.0" service="1234"/>

View File

@ -491,6 +491,7 @@ c.add_compare(""" \
--input tablet \
\
--serial tcp,host=:2222,mode=bind,protocol=telnet,log_file=/tmp/foo.log,log_append=yes \
--serial nmdm,source.master=/dev/foo1,source.slave=/dev/foo2 \
--parallel udp,host=0.0.0.0:1234,bind_host=127.0.0.1:1234 \
--parallel unix,path=/tmp/foo-socket \
--channel pty,target_type=guestfwd,target_address=127.0.0.1:10000 \

View File

@ -603,6 +603,9 @@ Foo bar baz &amp; yeah boii &lt; &gt; yeahfoo
<source mode='bind' host='my.source.host' service='1234'/>
<protocol type='telnet'/>
</serial>
<serial type="nmdm">
<source master="/dev/nmdm0A" slave="/dev/nmdm0B"/>
</serial>
<!-- parallel devices -->

View File

@ -2375,6 +2375,8 @@ _ParserChar.add_arg(None, "host", cb=_ParserChar.set_host_cb)
_ParserChar.add_arg(None, "bind_host", cb=_ParserChar.set_bind_cb)
_ParserChar.add_arg(None, "target_address", cb=_ParserChar.set_target_cb)
_ParserChar.add_arg("source_mode", "mode")
_ParserChar.add_arg("source_master", "source.master")
_ParserChar.add_arg("source_slave", "source.slave")
_ParserChar.add_arg("log_file", "log.file")
_ParserChar.add_arg("log_append", "log.append", is_onoff=True)

View File

@ -39,6 +39,7 @@ class _VirtualCharDevice(VirtualDevice):
TYPE_UNIX = "unix"
TYPE_SPICEVMC = "spicevmc"
TYPE_SPICEPORT = "spiceport"
TYPE_NMDM = "nmdm"
# We don't list the non-UI friendly types here
_TYPES_FOR_ALL = [TYPE_PTY, TYPE_DEV, TYPE_FILE,
@ -146,6 +147,8 @@ class _VirtualCharDevice(VirtualDevice):
"source_host" : [self.TYPE_TCP, self.TYPE_UDP],
"source_port" : [self.TYPE_TCP, self.TYPE_UDP],
"source_channel": [self.TYPE_SPICEPORT],
"source_master" : [self.TYPE_NMDM],
"source_slave" : [self.TYPE_NMDM],
"protocol" : [self.TYPE_TCP],
"bind_host" : [self.TYPE_UDP],
"bind_port" : [self.TYPE_UDP],
@ -209,6 +212,8 @@ class _VirtualCharDevice(VirtualDevice):
source_channel = XMLProperty("./source/@channel",
doc=_("Source channel name."))
source_master = XMLProperty("./source/@master")
source_slave = XMLProperty("./source/@slave")
###################