Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit bdb4081

Browse files
committed
CharDevice: Enable checking for readonly property support
So we can introspectively show PTY path in virt-manager UI again
1 parent 91838f1 commit bdb4081

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

virtinst/VirtualCharDevice.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def __init__(self, conn, dev_type,
210210

211211
self.char_type = self._char_type
212212

213-
def supports_property(self, propname):
213+
def supports_property(self, propname, ro=False):
214214
"""
215215
Whether the character dev type supports the passed property name
216216
"""
@@ -225,6 +225,9 @@ def supports_property(self, propname):
225225
"bind_port" : [self.CHAR_UDP],
226226
}
227227

228+
if ro:
229+
users["source_path"] += [self.CHAR_PTY]
230+
228231
channel_users = {
229232
"target_name" : [self.CHAR_CHANNEL_TARGET_VIRTIO],
230233
}
@@ -485,6 +488,9 @@ def __init__(self, conn, parsexml=None, parsexmlnode=None):
485488
class VirtualCharPtyDevice(VirtualCharDevice):
486489
_char_type = VirtualCharDevice.CHAR_PTY
487490
_char_xml = VirtualCharDevice._char_empty_xml
491+
source_path = property(VirtualCharDevice.get_source_path,
492+
VirtualCharDevice.set_source_path,
493+
doc=_("PTY allocated to the guest."))
488494
class VirtualCharStdioDevice(VirtualCharDevice):
489495
_char_type = VirtualCharDevice.CHAR_STDIO
490496
_char_xml = VirtualCharDevice._char_empty_xml

0 commit comments

Comments
 (0)