mirror of
https://src.fedoraproject.org/rpms/virt-manager.git
synced 2025-07-16 17:14:53 +00:00
90 lines
3.6 KiB
Diff
90 lines
3.6 KiB
Diff
# HG changeset patch
|
|
# User Cole Robinson <crobinso@redhat.com>
|
|
# Date 1236957667 14400
|
|
# Node ID 4331403b2e66dafdda618283dcea259a66fba423
|
|
# Parent 89c007e38850e1283447ea4c19ff6f64ce6224b6
|
|
Fix xml parsing for old style 'console' xml.
|
|
|
|
diff -r 89c007e38850 -r 4331403b2e66 src/virtManager/details.py
|
|
--- a/src/virtManager/details.py Mon Mar 09 23:38:03 2009 -0400
|
|
+++ b/src/virtManager/details.py Fri Mar 13 11:21:07 2009 -0400
|
|
@@ -1106,7 +1106,7 @@
|
|
_("(Primary Console)") or "")
|
|
self.window.get_widget("char-type").set_markup(typelabel)
|
|
self.window.get_widget("char-dev-type").set_text(charinfo[4] or "-")
|
|
- self.window.get_widget("char-target-port").set_text(charinfo[3])
|
|
+ self.window.get_widget("char-target-port").set_text(charinfo[3] or "")
|
|
self.window.get_widget("char-source-path").set_text(charinfo[5] or "-")
|
|
|
|
def refresh_hostdev_page(self):
|
|
diff -r 89c007e38850 -r 4331403b2e66 src/virtManager/domain.py
|
|
--- a/src/virtManager/domain.py Mon Mar 09 23:38:03 2009 -0400
|
|
+++ b/src/virtManager/domain.py Fri Mar 13 11:21:07 2009 -0400
|
|
@@ -806,7 +806,7 @@
|
|
def _parse_char_devs(ctx):
|
|
chars = []
|
|
devs = []
|
|
- devs = ctx.xpathEval("/domain/devices/console")
|
|
+ devs.extend(ctx.xpathEval("/domain/devices/console"))
|
|
devs.extend(ctx.xpathEval("/domain/devices/parallel"))
|
|
devs.extend(ctx.xpathEval("/domain/devices/serial"))
|
|
|
|
@@ -822,7 +822,7 @@
|
|
target_port = None
|
|
source_path = None
|
|
|
|
- for child in node.children:
|
|
+ for child in node.children or []:
|
|
if child.name == "target":
|
|
target_port = child.prop("port")
|
|
if child.name == "source":
|
|
# HG changeset patch
|
|
# User Cole Robinson <crobinso@redhat.com>
|
|
# Date 1236969355 14400
|
|
# Node ID 403916479f503f79f23bb682698b38f595eb0626
|
|
# Parent 81c591e8c64053840c12dac67ee06b5b97d419e7
|
|
Handle old style 'console' tag in 'Connect to serial' list.
|
|
|
|
diff -r 81c591e8c640 -r 403916479f50 src/virtManager/domain.py
|
|
--- a/src/virtManager/domain.py Fri Mar 13 14:35:28 2009 -0400
|
|
+++ b/src/virtManager/domain.py Fri Mar 13 14:35:55 2009 -0400
|
|
@@ -606,8 +606,9 @@
|
|
def _parse_serial_consoles(ctx):
|
|
# [ Name, device type, source path
|
|
serial_list = []
|
|
- devs = ctx.xpathEval("/domain/devices/serial")
|
|
- for node in devs:
|
|
+ sdevs = ctx.xpathEval("/domain/devices/serial")
|
|
+ cdevs = ctx.xpathEval("/domain/devices/console")
|
|
+ for node in sdevs:
|
|
name = "Serial "
|
|
dev_type = node.prop("type")
|
|
source_path = None
|
|
@@ -622,6 +623,26 @@
|
|
|
|
serial_list.append([name, dev_type, source_path])
|
|
|
|
+ for node in cdevs:
|
|
+ name = "Serial Console"
|
|
+ dev_type = "pty"
|
|
+ source_path = None
|
|
+ inuse = False
|
|
+
|
|
+ for child in node.children:
|
|
+ if child.name == "source":
|
|
+ source_path = child.prop("path")
|
|
+ break
|
|
+
|
|
+ if source_path:
|
|
+ for dev in serial_list:
|
|
+ if source_path == dev[2]:
|
|
+ inuse = True
|
|
+ break
|
|
+
|
|
+ if not inuse:
|
|
+ serial_list.append([name, dev_type, source_path])
|
|
+
|
|
return serial_list
|
|
return self._parse_device_xml(_parse_serial_consoles)
|
|
|