Hello Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/29546

to review the following change.

Change subject: ipwrapper: do not report devices that disappear
......................................................................

ipwrapper: do not report devices that disappear

There was a race in getLinks that consisted on devices disappearing
between them being reported by netlink and information being
retrieved by the Link class (driver info).

This patch solves it by reporting just those links that suceed.

Change-Id: Ib41336f3ac2f2278db2706f7d4eb3a9b579f66d4
Bug-Url: https://bugzilla.redhat.com/1113948
Signed-off-by: Antoni S. Puimedon <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/29442
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M lib/vdsm/ipwrapper.py
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/29546/1

diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index b1dd83d..cd4b7d4 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -286,7 +286,13 @@
 
 def getLinks():
     """Returns a list of Link objects for each link in the system."""
-    return [Link.fromDict(data) for data in netlink.iter_links()]
+    links = []
+    for data in netlink.iter_links():
+        try:
+            links.append(Link.fromDict(data))
+        except IOError:  # If a link goes missing we just don't report it
+            continue
+    return links
 
 
 def getLink(dev):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib41336f3ac2f2278db2706f7d4eb3a9b579f66d4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to