virtManager: Remove network virtualport UI

This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
* network virtualport configuration: this is some really obscure
stuff for configuring VEPA for macvtap devices. I don't think it gets
any usage in practice. I think a smaller subset of this UI is shared
with openswitch config but I believe it's just a single field, we
could keep that even though I don't think many people use it either
"""

This removes it all. The openvswitch piece was not properly wired
up anyways, since it requires setting virtualport type for a bridge.
For users that know they need that, they can add it via the XML
editor.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-01-25 14:28:33 -05:00
parent 3c861131dd
commit b4b497e28f
9 changed files with 1 additions and 315 deletions

View File

@ -320,23 +320,6 @@ class AddHardware(uiutils.UITestCase):
finish.click()
uiutils.check_in_loop(lambda: details.active)
# Network with vport stuff
self._open_addhw_window(details)
tab = self._select_hw(addhw, "Network", "network-tab")
tab.find("MAC Address Field", "text").text = "00:11:0C:11:00:11"
src.click()
tab.find_fuzzy("OpenVSwitch", "menu item").click()
t = tab.find("Virtual port", "toggle button")
t.click()
t.find("Type:", "text").text = "802.1Qbg"
t.find("Managerid:", "text").text = "12"
t.find("Typeid:", "text").text = "1193046"
t.find("Typeid version:", "text").text = "1"
t.find("Instance id:", "text").text = (
"09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b")
finish.click()
uiutils.check_in_loop(lambda: details.active)
def testAddGraphics(self):
"""

View File

@ -280,21 +280,6 @@ class Details(uiutils.UITestCase):
appl.click()
uiutils.check_in_loop(lambda: not appl.sensitive)
# Network with vport stuff
src.click()
tab.find_fuzzy("OpenVSwitch",
"menu item").bring_on_screen().click()
t = tab.find("Virtual port", "toggle button")
t.click()
t.find("Type:", "text").text = "802.1Qbg"
t.find("Managerid:", "text").text = "12"
t.find("Typeid:", "text").text = "1193046"
t.find("Typeid version:", "text").text = "1"
t.find("Instance id:", "text").text = (
"09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b")
appl.click()
uiutils.check_in_loop(lambda: not appl.sensitive)
def testDetailsEditDevices(self):
"""

View File

@ -629,22 +629,6 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="network-vport-align">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child internal-child="accessible">
<object class="AtkObject" id="box2-atkobject">
<property name="AtkObject::accessible-name">network-tab</property>

View File

@ -3530,20 +3530,6 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="network-vport-align">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child internal-child="accessible">
<object class="AtkObject" id="vbox54-atkobject">
<property name="AtkObject::accessible-name">network-tab</property>

View File

@ -195,182 +195,4 @@
<property name="use_underline">True</property>
<property name="mnemonic_widget">net-source</property>
</object>
<object class="GtkExpander" id="vport-expander">
<property name="can_focus">True</property>
<child>
<object class="GtkBox" id="hbox1124">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
<object class="GtkGrid" id="table10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">3</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkEntry" id="vport-instanceid">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="invisible_char">●</property>
<property name="width_chars">30</property>
<signal name="changed" handler="on_vport_instanceid_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="vport-instanceid-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Ins_tance id:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">vport-instanceid</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="vport-typeidversion">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="invisible_char">●</property>
<property name="width_chars">30</property>
<signal name="changed" handler="on_vport_typeidversion_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="vport-typeidversion-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Typ_eid version:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">vport-typeidversion</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="vport-typeid">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="invisible_char">●</property>
<property name="width_chars">30</property>
<signal name="changed" handler="on_vport_typeid_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="vport-typeid-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="label" translatable="yes">T_ypeid:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">vport-typeid</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="vport-managerid">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="invisible_char">●</property>
<property name="width_chars">30</property>
<signal name="changed" handler="on_vport_managerid_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="vport-managerid-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="label" translatable="yes">M_anagerid:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">vport-managerid</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="label" translatable="yes">_Type:</property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">vport-type</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="vport-type">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="invisible_char">●</property>
<property name="width_chars">30</property>
<signal name="changed" handler="on_vport_type_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Virtual _port</property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
</interface>

View File

@ -87,7 +87,6 @@ class vmmAddHardware(vmmGObjectUI):
self._netlist = vmmNetworkList(self.conn, self.builder, self.topwin)
self.widget("network-source-label-align").add(self._netlist.top_label)
self.widget("network-source-ui-align").add(self._netlist.top_box)
self.widget("network-vport-align").add(self._netlist.top_vport)
self.addstorage = vmmAddStorage(self.conn, self.builder, self.topwin)
self.widget("storage-align").add(self.addstorage.top_box)

View File

@ -68,7 +68,6 @@ from ..xmleditor import vmmXMLEditor
EDIT_SMARTCARD_MODE,
EDIT_NET_MODEL,
EDIT_NET_VPORT,
EDIT_NET_SOURCE,
EDIT_NET_MAC,
EDIT_NET_LINKSTATE,
@ -97,7 +96,7 @@ from ..xmleditor import vmmXMLEditor
EDIT_FS,
EDIT_HOSTDEV_ROMBAR) = range(1, 52)
EDIT_HOSTDEV_ROMBAR) = range(1, 51)
# Columns in hw list model
@ -405,11 +404,8 @@ class vmmDetails(vmmGObjectUI):
self.netlist = vmmNetworkList(self.conn, self.builder, self.topwin)
self.widget("network-source-label-align").add(self.netlist.top_label)
self.widget("network-source-ui-align").add(self.netlist.top_box)
self.widget("network-vport-align").add(self.netlist.top_vport)
self.netlist.connect("changed",
lambda x: self.enable_apply(x, EDIT_NET_SOURCE))
self.netlist.connect("changed-vport",
lambda x: self.enable_apply(x, EDIT_NET_VPORT))
self.vsockdetails = vmmVsockDetails(self.vm, self.builder, self.topwin)
self.widget("vsock-align").add(self.vsockdetails.top_box)
@ -1754,11 +1750,6 @@ class vmmDetails(vmmGObjectUI):
kwargs["mode"], kwargs["portgroup"]) = (
self.netlist.get_network_selection())
if self.edited(EDIT_NET_VPORT):
(kwargs["vtype"], kwargs["managerid"],
kwargs["typeid"], kwargs["typeidversion"],
kwargs["instanceid"]) = self.netlist.get_vport()
if self.edited(EDIT_NET_MAC):
kwargs["macaddr"] = self.widget("network-mac-entry").get_text()
virtinst.DeviceInterface.is_conflict_net(

View File

@ -20,7 +20,6 @@ NetDev = collections.namedtuple('Netdev', ['name', 'is_bridge', 'slave_names'])
class vmmNetworkList(vmmGObjectUI):
__gsignals__ = {
"changed": (vmmGObjectUI.RUN_FIRST, None, []),
"changed-vport": (vmmGObjectUI.RUN_FIRST, None, [])
}
def __init__(self, conn, builder, topwin):
@ -33,18 +32,11 @@ class vmmNetworkList(vmmGObjectUI):
"on_net_source_mode_changed": self._emit_changed,
"on_net_portgroup_changed": self._emit_changed,
"on_net_bridge_name_changed": self._emit_changed,
"on_vport_type_changed": self._emit_vport_changed,
"on_vport_managerid_changed": self._emit_vport_changed,
"on_vport_typeid_changed": self._emit_vport_changed,
"on_vport_typeidversion_changed": self._emit_vport_changed,
"on_vport_instanceid_changed": self._emit_vport_changed,
})
self._init_ui()
self.top_label = self.widget("net-source-label")
self.top_box = self.widget("net-source-box")
self.top_vport = self.widget("vport-expander")
def _cleanup(self):
self.conn.disconnect_by_obj(self)
@ -52,7 +44,6 @@ class vmmNetworkList(vmmGObjectUI):
self.top_label.destroy()
self.top_box.destroy()
self.top_vport.destroy()
##########################
@ -345,16 +336,6 @@ class vmmNetworkList(vmmGObjectUI):
return net_type, net_src, mode, portgroup or None
def get_vport(self):
vport_type = self.widget("vport-type").get_text()
vport_managerid = self.widget("vport-managerid").get_text()
vport_typeid = self.widget("vport-typeid").get_text()
vport_idver = self.widget("vport-typeidversion").get_text()
vport_instid = self.widget("vport-instanceid").get_text()
return (vport_type, vport_managerid, vport_typeid,
vport_idver, vport_instid)
def build_device(self, macaddr, model=None):
nettype, devname, mode, portgroup = self.get_network_selection()
@ -366,16 +347,6 @@ class vmmNetworkList(vmmGObjectUI):
net.source_mode = mode
net.portgroup = portgroup
if net.type == "direct":
(vport_type, vport_managerid, vport_typeid,
vport_idver, vport_instid) = self.get_vport()
net.virtualport.type = vport_type or None
net.virtualport.managerid = vport_managerid or None
net.virtualport.typeid = vport_typeid or None
net.virtualport.typeidversion = vport_idver or None
net.virtualport.instanceid = vport_instid or None
return net
def validate_device(self, net):
@ -399,12 +370,6 @@ class vmmNetworkList(vmmGObjectUI):
self.widget("net-source-mode").set_active(0)
self.widget("net-portgroup").get_child().set_text("")
self.widget("vport-type").set_text("")
self.widget("vport-managerid").set_text("")
self.widget("vport-typeid").set_text("")
self.widget("vport-typeidversion").set_text("")
self.widget("vport-instanceid").set_text("")
def set_dev(self, net):
self.reset_state()
@ -419,21 +384,8 @@ class vmmNetworkList(vmmGObjectUI):
nettype = "network"
source_mode = net.source_mode
is_direct = (net.type == "direct")
uiutil.set_list_selection(self.widget("net-source-mode"), source_mode)
# Virtualport config
self.widget("vport-expander").set_visible(is_direct)
vport = net.virtualport
self.widget("vport-type").set_text(vport.type or "")
self.widget("vport-managerid").set_text(str(vport.managerid or ""))
self.widget("vport-typeid").set_text(str(vport.typeid or ""))
self.widget("vport-typeidversion").set_text(
str(vport.typeidversion or ""))
self.widget("vport-instanceid").set_text(vport.instanceid or "")
# Find the matching row in the net list
combo = self.widget("net-source")
rowiter = None
@ -467,11 +419,6 @@ class vmmNetworkList(vmmGObjectUI):
ignore2 = kwargs
self.emit("changed")
def _emit_vport_changed(self, *args, **kwargs):
ignore1 = args
ignore2 = kwargs
self.emit("changed-vport")
def _repopulate_network_list(self, *args, **kwargs):
ignore1 = args
ignore2 = kwargs
@ -520,9 +467,7 @@ class vmmNetworkList(vmmGObjectUI):
if not row:
return
is_openvswitch = row[2].endswith("(OpenVSwitch)")
is_direct = (row[0] == virtinst.DeviceInterface.TYPE_DIRECT)
self.widget("vport-expander").set_visible(is_direct or is_openvswitch)
uiutil.set_grid_row_visible(self.widget("net-source-mode"), is_direct)
uiutil.set_grid_row_visible(
self.widget("net-macvtap-warn-box"), is_direct)

View File

@ -718,8 +718,6 @@ class vmmDomain(vmmLibvirtObject):
def define_network(self, devobj, do_hotplug,
ntype=_SENTINEL, source=_SENTINEL,
mode=_SENTINEL, model=_SENTINEL,
vtype=_SENTINEL, managerid=_SENTINEL, typeid=_SENTINEL,
typeidversion=_SENTINEL, instanceid=_SENTINEL,
portgroup=_SENTINEL, macaddr=_SENTINEL, linkstate=_SENTINEL):
xmlobj = self._make_xmlobj_to_define()
editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
@ -739,13 +737,6 @@ class vmmDomain(vmmLibvirtObject):
editdev.address.clear()
editdev.model = model
if vtype != _SENTINEL:
editdev.virtualport.type = vtype or None
editdev.virtualport.managerid = managerid or None
editdev.virtualport.typeid = typeid or None
editdev.virtualport.typeidversion = typeidversion or None
editdev.virtualport.instanceid = instanceid or None
if macaddr != _SENTINEL:
editdev.macaddr = macaddr