mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-07 00:58:30 +03:00
Added OpenVSwitch Network Detection
Small patch to allow VMM to detect OpenVSwitch Signed-off-by: Charles d'Hondt <charles.dhondt@gmail.com>
This commit is contained in:
parent
24a073a9bc
commit
b545201617
@ -46,6 +46,7 @@
|
||||
<inbound average="3000" peak="4000" burst="5220"/>
|
||||
<outbound average="2000" peak="3000" burst="5120"/>
|
||||
</bandwidth>
|
||||
<virtualport type="openvswitch"/>
|
||||
<mac address="52:54:00:69:eb:FF"/>
|
||||
<route family="ipv4" address="192.168.8.0" prefix="24" gateway="192.168.8.10"/>
|
||||
</network>
|
||||
|
@ -1241,6 +1241,7 @@ class XMLParseTest(unittest.TestCase):
|
||||
check("domain_name", "net7", "newdom")
|
||||
check("ipv6", None, True)
|
||||
check("macaddr", None, "52:54:00:69:eb:FF")
|
||||
check("virtualport_type", None, "openvswitch")
|
||||
|
||||
check = self._make_checker(net.forward)
|
||||
check("mode", "nat", "route")
|
||||
|
@ -146,6 +146,9 @@ class vmmNetworkList(vmmGObjectUI):
|
||||
if not net.is_active():
|
||||
label += " (%s)" % _("Inactive")
|
||||
|
||||
if net.get_xmlobj().virtualport_type == "openvswitch":
|
||||
label += " (OpenVSwitch)"
|
||||
|
||||
if net.get_name() == "default":
|
||||
default_label = label
|
||||
|
||||
@ -526,8 +529,9 @@ class vmmNetworkList(vmmGObjectUI):
|
||||
if not row:
|
||||
return
|
||||
|
||||
is_openvswitch = row[2].endswith("(OpenVSwitch)")
|
||||
is_direct = (row[0] == virtinst.VirtualNetworkInterface.TYPE_DIRECT)
|
||||
self.widget("vport-expander").set_visible(is_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)
|
||||
|
@ -212,7 +212,7 @@ class Network(XMLBuilder):
|
||||
##################
|
||||
|
||||
_XML_ROOT_NAME = "network"
|
||||
_XML_PROP_ORDER = ["ipv6", "name", "uuid", "forward",
|
||||
_XML_PROP_ORDER = ["ipv6", "name", "uuid", "forward", "virtualport_type",
|
||||
"bridge", "stp", "delay", "domain_name",
|
||||
"macaddr", "ips", "routes", "bandwidth"]
|
||||
|
||||
@ -222,6 +222,8 @@ class Network(XMLBuilder):
|
||||
validate_cb=lambda s, v: util.validate_uuid(v),
|
||||
default_cb=_get_default_uuid)
|
||||
|
||||
virtualport_type = XMLProperty("./virtualport/@type")
|
||||
|
||||
# Not entirely correct, there can be multiple routes
|
||||
forward = XMLChildProperty(_NetworkForward, is_single=True)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user