mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
details: If we know the channel target name, pretty list it
This commit is contained in:
parent
0366589812
commit
ff73f1119e
@ -266,7 +266,11 @@
|
|||||||
<address type='virtio-serial' controller='1' bus='0' port='3'/>
|
<address type='virtio-serial' controller='1' bus='0' port='3'/>
|
||||||
</channel>
|
</channel>
|
||||||
<channel type='pty'>
|
<channel type='pty'>
|
||||||
<target type='virtio' name='org.linux-kvm.port.0'/>
|
<target type='virtio' name='org.qemu.guest_agent.0'/>
|
||||||
|
</channel>
|
||||||
|
<channel type='unix'>
|
||||||
|
<source mode='bind'/>
|
||||||
|
<target type='virtio' name='org.libguestfs.channel.0'/>
|
||||||
</channel>
|
</channel>
|
||||||
|
|
||||||
|
|
||||||
|
@ -3511,9 +3511,12 @@ class vmmDetails(vmmGObjectUI):
|
|||||||
port = chardev.target_port
|
port = chardev.target_port
|
||||||
|
|
||||||
label = devtype.capitalize()
|
label = devtype.capitalize()
|
||||||
if devtype not in ["console", "channel"]:
|
if devtype in ["serial", "parallel"]:
|
||||||
# Don't show port for console
|
|
||||||
label += " %s" % (int(port) + 1)
|
label += " %s" % (int(port) + 1)
|
||||||
|
elif devtype == "channel":
|
||||||
|
name = chardev.pretty_channel_name(chardev.target_name)
|
||||||
|
if name:
|
||||||
|
label += " %s" % name
|
||||||
|
|
||||||
update_hwlist(HW_LIST_TYPE_CHAR, chardev, label,
|
update_hwlist(HW_LIST_TYPE_CHAR, chardev, label,
|
||||||
"device_serial")
|
"device_serial")
|
||||||
|
@ -71,6 +71,16 @@ class _VirtualCharDevice(VirtualDevice):
|
|||||||
CHANNEL_NAME_QEMUGA,
|
CHANNEL_NAME_QEMUGA,
|
||||||
CHANNEL_NAME_LIBGUESTFS]
|
CHANNEL_NAME_LIBGUESTFS]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def pretty_channel_name(val):
|
||||||
|
if val == _VirtualCharDevice.CHANNEL_NAME_SPICE:
|
||||||
|
return "spice"
|
||||||
|
if val == _VirtualCharDevice.CHANNEL_NAME_QEMUGA:
|
||||||
|
return "qemu-ga"
|
||||||
|
if val == _VirtualCharDevice.CHANNEL_NAME_LIBGUESTFS:
|
||||||
|
return "libguestfs"
|
||||||
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def pretty_type(ctype):
|
def pretty_type(ctype):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user