Change in vdsm[master]: ipwrapper: add support for veth NICs

pbenas at redhat.com pbenas at redhat.com
Mon Nov 18 15:58:47 UTC 2013


Petr Benas has uploaded a new change for review.

Change subject: ipwrapper: add support for veth NICs
......................................................................

ipwrapper: add support for veth NICs

Update ipwrapper to consider veth NICs as FakeNICs in the same
way it does with dummy NICs. This change is required for the
testSetupNetworksAddDelDhcp functional test.

Change-Id: Ifc85a1d4c81b270025916b6bc650aa382fbb37ce
Signed-off-by: Petr Benas <pbenas at redhat.com>
---
M lib/vdsm/ipwrapper.py
1 file changed, 11 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/21381/1

diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index 2210897..afd7f6c 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -67,6 +67,7 @@
     TUN = 'tun'
     OVS = 'openvswitch'
     TEAM = 'team'
+    VETH = 'veth'
 
 
 @equals
@@ -88,7 +89,7 @@
             self.vlanprotocol = vlanprotocol
         for key, value in kwargs.items():
             setattr(self, key, value)
-        if linkType == LinkType.DUMMY:
+        if linkType == LinkType.DUMMY or linkType == LinkType.VETH:
             self._fakeNics = config.get('vars', 'fake_nics').split(',')
             self._hiddenNics = config.get('vars', 'hidden_nics').split(',')
         if linkType == LinkType.NIC:
@@ -186,20 +187,26 @@
     def isNIC(self):
         return self.type == LinkType.NIC
 
+    def isVETH(self):
+        return self.type == LinkType.VETH
+
     def isVLAN(self):
         return self.type == LinkType.VLAN
 
     def isFakeNIC(self):
         """
-        Returns True iff vdsm config marks the DUMMY dev to be reported as NIC.
+        Returns True iff vdsm config marks the DUMMY or VETH dev to be reported
+        as NIC.
         """
-        return self.isDUMMY() and anyFnmatch(self.name, self._fakeNics)
+        if self.isDUMMY() or self.isVETH():
+            return anyFnmatch(self.name, self._fakeNics)
+        return False
 
     def isHidden(self):
         """Returns True iff vdsm config hides the device."""
         if self.isVLAN():
             return anyFnmatch(self.name, self._hiddenVlans)
-        elif self.isDUMMY() or self.isNIC():
+        elif self.isDUMMY() or self.isVETH() or self.isNIC():
             return anyFnmatch(self.name, self._hiddenNics)
         else:
             raise NotImplementedError


-- 
To view, visit http://gerrit.ovirt.org/21381
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc85a1d4c81b270025916b6bc650aa382fbb37ce
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Benas <pbenas at redhat.com>


More information about the vdsm-patches mailing list