[virt-tools-list] [virt-manager PATCH] Added OpenVSwitch Network Detection
Cole Robinson
crobinso at redhat.com
Thu Mar 23 15:12:46 UTC 2017
On 03/23/2017 11:06 AM, Charles d'Hondt wrote:
> Small patch to allow VMM to detect OpenVSwitch
>
> Signed-off-by: Charles d'Hondt <charles.dhondt at gmail.com>
> ---
> virtManager/netlist.py | 6 +++++-
> virtinst/network.py | 4 +++-
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
Can you provide an example openvswitch <network> config? So I can test locally
with tests/testdriver.xml
Thanks,
Cole
> diff --git a/virtManager/netlist.py b/virtManager/netlist.py
> index bdadbf3..aae87b4 100644
> --- a/virtManager/netlist.py
> +++ b/virtManager/netlist.py
> @@ -146,6 +146,9 @@ class vmmNetworkList(vmmGObjectUI):
> if not net.is_active():
> label += " (%s)" % _("Inactive")
>
> + if net.get_xmlobj().virtualport_type == "openvswitch":
> + label += " (%s)" % "OpenVSwitch"
> +
> if net.get_name() == "default":
> default_label = label
>
> @@ -526,8 +529,9 @@ class vmmNetworkList(vmmGObjectUI):
> if not row:
> return
>
> + is_openvswitch = (row[2][-12:-1] == "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)
> diff --git a/virtinst/network.py b/virtinst/network.py
> index 80c03d4..28d257b 100644
> --- a/virtinst/network.py
> +++ b/virtinst/network.py
> @@ -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)
>
>
More information about the virt-tools-list
mailing list