Change in vdsm[master]: Make getVlanDevice use the faster netlink information

asegurap at redhat.com asegurap at redhat.com
Tue Feb 25 09:15:28 UTC 2014


Antoni Segura Puimedon has uploaded a new change for review.

Change subject: Make getVlanDevice use the faster netlink information
......................................................................

Make getVlanDevice use the faster netlink information

getVlanId was already using the newer and faster netlink information
while getVlanDevice had remained creating a process and parsing the
output. This patch makes it more consistent and faster.

Change-Id: Ib5ab4fd8fa454770669cbc1f8428e80cd70ec66c
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/24989/1

diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 02a4f9c..421d11b 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -671,11 +671,8 @@
 
 def getVlanDevice(vlan):
     """ Return the device of the given VLAN. """
-    out = linkShowDev(vlan)
-
-    # out example:
-    # 6: eth0.10 at eth0: <BROADCAST,MULTICAST> mtu 1500...
-    return str(out).split(':')[1].strip().split('@')[1]
+    vlanLink = getLink(vlan)
+    return vlanLink.device
 
 
 def getVlanID(vlan):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5ab4fd8fa454770669cbc1f8428e80cd70ec66c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>


More information about the vdsm-patches mailing list