Don't list <console> tag in serial list if primary console is not PTY.

This commit is contained in:
Cole Robinson 2009-07-14 19:25:17 -04:00
parent c5f9c7dbe8
commit 6658f4fe40
2 changed files with 10 additions and 6 deletions

View File

@ -860,7 +860,7 @@ class vmmDetails(gobject.GObject):
# If the dialog is visible, we want to make sure the XML is always # If the dialog is visible, we want to make sure the XML is always
# up to date # up to date
if self.is_visible(): if self.is_visible():
self.vm.refresh_xml() self.vm.refresh_xml()
if (page == PAGE_DETAILS and if (page == PAGE_DETAILS and
self.get_hw_selection(HW_LIST_COL_TYPE) == HW_LIST_TYPE_STATS): self.get_hw_selection(HW_LIST_COL_TYPE) == HW_LIST_TYPE_STATS):

View File

@ -711,27 +711,31 @@ class vmmDomain(gobject.GObject):
if child.name == "source": if child.name == "source":
source_path = child.prop("path") source_path = child.prop("path")
serial_list.append([name, dev_type, source_path]) serial_list.append([name, dev_type, source_path, target_port])
for node in cdevs: for node in cdevs:
name = "Serial Console" name = "Serial Console"
dev_type = "pty" dev_type = "pty"
source_path = None source_path = None
target_port = -1
inuse = False inuse = False
for child in node.children: for child in node.children:
if child.name == "source": if child.name == "source":
source_path = child.prop("path") source_path = child.prop("path")
break
if source_path: if child.name == "target":
target_port = child.prop("port")
if target_port != -1:
for dev in serial_list: for dev in serial_list:
if source_path == dev[2]: if target_port == dev[3]:
inuse = True inuse = True
break break
if not inuse: if not inuse:
serial_list.append([name, dev_type, source_path]) serial_list.append([name, dev_type, source_path,
target_port])
return serial_list return serial_list
return self._parse_device_xml(_parse_serial_consoles) return self._parse_device_xml(_parse_serial_consoles)