Antoni Segura Puimedon has uploaded a new change for review.
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 <asegurap(a)redhat.com>
---
M lib/vdsm/ipwrapper.py
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/29442/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/29442
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib41336f3ac2f2278db2706f7d4eb3a9b579f66d4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>