cli: Add --serial type= arg, with back compat alias char_type

'type' is the expected naming here

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2019-12-24 12:02:53 -05:00
parent 2138cca6a5
commit 637781fca2
2 changed files with 5 additions and 4 deletions

View File

@ -641,9 +641,9 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
--input tablet
--input mouse
--serial tcp,host=:2222,mode=bind,protocol=telnet,log.file=/tmp/foo.log,log.append=yes,,target.model.name=pci-serial
--serial char_type=tcp,host=:2222,mode=bind,protocol=telnet,log.file=/tmp/foo.log,log.append=yes,,target.model.name=pci-serial
--serial nmdm,source.master=/dev/foo1,source.slave=/dev/foo2,alias.name=testalias7
--parallel udp,host=0.0.0.0:1234,bind_host=127.0.0.1:1234
--parallel type=udp,host=0.0.0.0:1234,bind_host=127.0.0.1:1234
--parallel udp,source.connect_host=127.0.0.2,source.connect_service=8888,source.bind_host=127.0.0.1,source.bind_service=7777
--parallel unix,path=/tmp/foo-socket,source.seclabel0.model=none,source.seclabel1.model=dac,source.seclabel1.relabel=yes,source.seclabel1.label=foobar,source.seclabel.relabel=no
--channel pty,target_type=guestfwd,target_address=127.0.0.1:10000

View File

@ -3836,9 +3836,10 @@ class ParserVsock(VirtCLIParser):
######################################################
class _ParserChar(VirtCLIParser):
remove_first = "char_type"
remove_first = "type"
stub_none = False
aliases = {
"type": "char_type",
"protocol.type": "protocol",
"target.address": "target_address",
@ -3893,7 +3894,7 @@ class _ParserChar(VirtCLIParser):
VirtCLIParser._init_class(**kwargs)
_add_common_device_args(cls)
cls.add_arg("char_type", "type")
cls.add_arg("type", "type")
# These are handled in _add_advertised_aliases
cls.add_arg("path", "source.path", cb=cls.noset_cb)