[virt-tools-list] [virt-manager PATCH] Added OpenVSwitch Network Detection
Cole Robinson
crobinso at redhat.com
Mon Mar 27 20:56:31 UTC 2017
On 03/27/2017 09:33 AM, Charles d'Hondt wrote:
> Nice !
> I also noticed something that seems a bit odd, when launching a VM with the
> example I gave you, the Virtual Network Interface in the details of the
> virtual hardware will switch back to "Specify shared device name" mode with
> bridge name set to br1 instead of staying in the bridge network mode. Any
> thought of why this is occuring ?
>
Hmm, I'm not seeing that. It should only show the 'shared device name' field
if the VM interface is type=bridge. What's the VM's <interface> XML look like?
- Cole
>
> On Fri, Mar 24, 2017 at 9:43 PM, Cole Robinson <crobinso at redhat.com
> <mailto:crobinso at redhat.com>> wrote:
>
> Thanks, I tweaked the string comparison in your patch a bit, extended the test
> suite a bit, and pushed.
>
> - Cole
>
> On 03/23/2017 11:19 AM, Charles d'Hondt wrote:
> > Here you go, a basic <network> config
> >
> > <network>
> > <name>ovsbr1</name>
> > <uuid>f6efa396-949f-41cd-8e26-ca5f60c150d1</uuid>
> > <forward mode='bridge'/>
> > <bridge name='br1'/>
> > <virtualport type='openvswitch'/>
> > </network>
> >
> >
> > On Thu, Mar 23, 2017 at 4:12 PM, Cole Robinson <crobinso at redhat.com <mailto:crobinso at redhat.com>
> > <mailto:crobinso at redhat.com <mailto:crobinso at redhat.com>>> wrote:
> >
> > 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
> <mailto:charles.dhondt at gmail.com> <mailto:charles.dhondt at gmail.com
> <mailto: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