From 2367e70efa444621d7293319bdfa6d01ac883260 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 25 Jan 2020 13:36:17 -0500 Subject: [PATCH] virtManager: Remove magic spapr-* device handling We have lots of spapr-* pretty printing and some magic handling spread around the codebase. These devices have fallen out of favor and are rarely used, so drop the special handling Signed-off-by: Cole Robinson --- tests/xmlparse.py | 2 +- virtManager/addhardware.py | 2 -- virtManager/details/details.py | 11 ++--------- virtManager/device/netlist.py | 2 -- virtManager/object/domain.py | 6 ++---- virtinst/devices/device.py | 2 -- 6 files changed, 5 insertions(+), 20 deletions(-) diff --git a/tests/xmlparse.py b/tests/xmlparse.py index fc128bc56..deae34873 100644 --- a/tests/xmlparse.py +++ b/tests/xmlparse.py @@ -1106,7 +1106,7 @@ class XMLParseTest(unittest.TestCase): adddev.type = "network" adddev.source = "default" adddev.macaddr = "1A:2A:3A:4A:5A:6A" - adddev.address.set_addrstr("spapr-vio") + adddev.address.type = "spapr-vio" adddev.set_defaults(guest) # Test adding and removing the same device diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py index 54e72da16..cece35f33 100644 --- a/virtManager/addhardware.py +++ b/virtManager/addhardware.py @@ -491,8 +491,6 @@ class vmmAddHardware(vmmGObjectUI): if dev.type == "scsi": if dev.model == "virtio-scsi": ret = "Virtio " + ret - elif dev.address.type == "spapr-vio": - ret = "sPAPR " + ret if dev.type == "pci" and dev.model == "pcie-root": ret = "PCIe" return ret diff --git a/virtManager/details/details.py b/virtManager/details/details.py index 08f91cfd7..256b1fa67 100644 --- a/virtManager/details/details.py +++ b/virtManager/details/details.py @@ -1720,11 +1720,8 @@ class vmmDetails(vmmGObjectUI): self.widget("disk-detect-zeroes")) if self.edited(EDIT_DISK_BUS): - bus = uiutil.get_list_selection(self.widget("disk-bus")) - addr = None - - kwargs["bus"] = bus - kwargs["addrstr"] = addr + kwargs["bus"] = uiutil.get_list_selection( + self.widget("disk-bus")) return vmmAddHardware.change_config_helper(self.vm.define_disk, kwargs, self.vm, self.err, @@ -1759,11 +1756,7 @@ class vmmDetails(vmmGObjectUI): if self.edited(EDIT_NET_MODEL): model = uiutil.get_list_selection(self.widget("network-model")) - addrstr = None - if model == "spapr-vlan": - addrstr = "spapr-vio" kwargs["model"] = model - kwargs["addrstr"] = addrstr if self.edited(EDIT_NET_SOURCE): (kwargs["ntype"], kwargs["source"], diff --git a/virtManager/device/netlist.py b/virtManager/device/netlist.py index 7085f3f21..a369830fa 100644 --- a/virtManager/device/netlist.py +++ b/virtManager/device/netlist.py @@ -365,8 +365,6 @@ class vmmNetworkList(vmmGObjectUI): net.model = model net.source_mode = mode net.portgroup = portgroup - if net.model == "spapr-vlan": - net.address.set_addrstr("spapr-vio") if net.type == "direct": (vport_type, vport_managerid, vport_typeid, diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py index a8b077c8a..84a6f4b6c 100644 --- a/virtManager/object/domain.py +++ b/virtManager/object/domain.py @@ -658,7 +658,7 @@ class vmmDomain(vmmLibvirtObject): path=_SENTINEL, readonly=_SENTINEL, shareable=_SENTINEL, removable=_SENTINEL, cache=_SENTINEL, io=_SENTINEL, discard=_SENTINEL, detect_zeroes=_SENTINEL, - bus=_SENTINEL, addrstr=_SENTINEL): + bus=_SENTINEL): xmlobj = self._make_xmlobj_to_define() editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug) if not editdev: @@ -673,7 +673,6 @@ class vmmDomain(vmmLibvirtObject): return editdev.address.clear() - editdev.address.set_addrstr(addrstr) if oldprefix == editdev.get_target_prefix()[0]: return @@ -721,7 +720,7 @@ class vmmDomain(vmmLibvirtObject): def define_network(self, devobj, do_hotplug, ntype=_SENTINEL, source=_SENTINEL, - mode=_SENTINEL, model=_SENTINEL, addrstr=_SENTINEL, + mode=_SENTINEL, model=_SENTINEL, vtype=_SENTINEL, managerid=_SENTINEL, typeid=_SENTINEL, typeidversion=_SENTINEL, instanceid=_SENTINEL, portgroup=_SENTINEL, macaddr=_SENTINEL, linkstate=_SENTINEL): @@ -741,7 +740,6 @@ class vmmDomain(vmmLibvirtObject): if model != _SENTINEL: if editdev.model != model: editdev.address.clear() - editdev.address.set_addrstr(addrstr) editdev.model = model if vtype != _SENTINEL: diff --git a/virtinst/devices/device.py b/virtinst/devices/device.py index 898c71993..c3676da55 100644 --- a/virtinst/devices/device.py +++ b/virtinst/devices/device.py @@ -69,8 +69,6 @@ class DeviceAddress(XMLBuilder): self.domain = "0" if ":" in addrstr: self.domain, self.bus = addrstr.split(":", 1) - elif addrstr == "spapr-vio": - self.type = self.ADDRESS_TYPE_SPAPR_VIO else: raise ValueError(_("Could not determine or unsupported " "format of '%s'") % addrstr)