Change in vdsm[master]: netinfo: do not mistake a veth device for a VLAN in ifaceUsed

osvoboda at redhat.com osvoboda at redhat.com
Wed Sep 30 16:19:03 UTC 2015


Ondřej Svoboda has uploaded a new change for review.

Change subject: netinfo: do not mistake a veth device for a VLAN in ifaceUsed
......................................................................

netinfo: do not mistake a veth device for a VLAN in ifaceUsed

A heuristic in the function looks for a 'device' property of a network
link to decide if a given device "backs" a VLAN and thus is "used".
Not only VLANs have the property, however. At least veth devices have it
as well. This patch improves detection by filtering out veths based on
'type' property.

At least testSetupNetworksAddDelDhcp was affected by this misdetection
on Fedora 22. The presence of 'device' property may be due to netlink
library but this is just a guess. (Also, iproute2 package/ip binary
recently started showing veth1 at veth2 in its output but this need not
be related either.)

Change-Id: Iee3b45fb38f136bf69c175cbd745c89f80c299cf
Signed-off-by: Ondřej Svoboda <osvoboda at redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/46867/1

diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 74aff95..ad75d67 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -1041,8 +1041,8 @@
     for linkDict in nl_link.iter_links():
         if linkDict['name'] == iface and 'master' in linkDict:  # Is it a slave
             return True
-        if linkDict.get('device') == iface:  # Does it back a vlan
-            return True
+        if linkDict.get('device') == iface and linkDict.get('type') != 'veth':
+            return True  # it (probably) backs a VLAN
     for name, info in networks().iteritems():
         if info.get('iface') == iface:
             return True


-- 
To view, visit https://gerrit.ovirt.org/46867
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee3b45fb38f136bf69c175cbd745c89f80c299cf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>


More information about the vdsm-patches mailing list