devices: char: drop tty fallback reading

This is only for ancient rhel5 era libvirt, We don't need it anymore
and it complicates XML handling
This commit is contained in:
Cole Robinson 2019-05-13 11:59:57 -04:00
parent e6eb1d447b
commit ba1764943b
4 changed files with 2 additions and 65 deletions

View File

@ -1,21 +0,0 @@
<domain type="test">
<name>xenpv-kernel</name>
<os>
<type>xen</type>
<kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
<initrd>/var/lib/xen/initrd.img.0u-Vhq</initrd>
<cmdline> method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test/5.91/x86_64/os </cmdline>
</os>
<memory>430080</memory>
<vcpu>2</vcpu>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<disk type="file" device="disk">
<source file="/root/some.img"/>
<target dev="xvda"/>
</disk>
<console tty="/dev/pts/4"/>
</devices>
</domain>

View File

@ -1,21 +0,0 @@
<domain type="test">
<name>xenpv-kernel</name>
<os>
<type>xen</type>
<kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
<initrd>/var/lib/xen/initrd.img.0u-Vhq</initrd>
<cmdline> method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test/5.91/x86_64/os </cmdline>
</os>
<memory>430080</memory>
<vcpu>2</vcpu>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<disk type="file" device="disk">
<source file="/root/some.img"/>
<target dev="xvda"/>
</disk>
<console tty="/dev/pts/4"/>
</devices>
</domain>

View File

@ -1035,16 +1035,6 @@ class XMLParseTest(unittest.TestCase):
self._alter_compare(guest.get_xml(), outfile)
def testConsoleCompat(self):
guest, outfile = self._get_test_content("console-compat")
dev1 = guest.devices.console[0]
check = self._make_checker(dev1)
check("source_path", "/dev/pts/4")
check("_tty", "/dev/pts/4", "foo", "/dev/pts/4")
self._alter_compare(guest.get_xml(), outfile)
def testPanicDevice(self):
guest, outfile = self._get_test_content("change-panic-device")

View File

@ -143,13 +143,12 @@ class _DeviceChar(Device):
_XML_PROP_ORDER = ["type",
"bind_host", "bind_service",
"source_mode", "connect_host", "connect_service",
"_source_path", "source_channel",
"source_path", "source_channel",
"target_type", "target_name", "target_state"]
type = XMLProperty("./@type")
_tty = XMLProperty("./@tty")
_source_path = XMLProperty("./source/@path")
source_path = XMLProperty("./source/@path")
source_channel = XMLProperty("./source/@channel")
source_master = XMLProperty("./source/@master")
source_slave = XMLProperty("./source/@slave")
@ -165,16 +164,6 @@ class _DeviceChar(Device):
log_file = XMLProperty("./log/@file")
log_append = XMLProperty("./log/@append", is_onoff=True)
# Convenience property to get source_path or tty, for old libvirt compat
def _get_source_path(self):
source = self._source_path
if source is None and self._tty:
return self._tty
return source
def _set_source_path(self, val):
self._source_path = val
source_path = property(_get_source_path, _set_source_path)
# Convenience source helpers for setting connect/bind host and service
connect_host = XMLProperty("./source[@mode='connect']/@host")
connect_service = XMLProperty(