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'/>
|
||||
</channel>
|
||||
<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>
|
||||
|
||||
|
||||
|
@ -3511,9 +3511,12 @@ class vmmDetails(vmmGObjectUI):
|
||||
port = chardev.target_port
|
||||
|
||||
label = devtype.capitalize()
|
||||
if devtype not in ["console", "channel"]:
|
||||
# Don't show port for console
|
||||
if devtype in ["serial", "parallel"]:
|
||||
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,
|
||||
"device_serial")
|
||||
|
@ -71,6 +71,16 @@ class _VirtualCharDevice(VirtualDevice):
|
||||
CHANNEL_NAME_QEMUGA,
|
||||
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
|
||||
def pretty_type(ctype):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user