Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-09-17 Thread Jenkins CI RO
Jenkins CI RO has abandoned this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Abandoned

Abandoned due to no activity - please restore if still relevant

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenkins CI RO
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-09-17 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 4:

* Update tracker: IGNORE, no Bug-Url found

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenkins CI RO
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-04-04 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 4:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 
'ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-04-04 Thread edwardh
Edward Haas has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/53968/3/vdsm/vdsm-restore-net-config
File vdsm/vdsm-restore-net-config:

PS3, Line 328: if not down_links:
 : mon.stop()
 : for event in mon:
My recommendation:

if down_links:
for event in mon:
if down_links:
link_name = event.get('name')



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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-04-04 Thread edwardh
Edward Haas has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3: -Code-Review

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-04-04 Thread edwardh
Edward Haas has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-04-04 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-25 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/53968/3/vdsm/vdsm-restore-net-config
File vdsm/vdsm-restore-net-config:

Line 319: available_bonds[bond]['nics'] = available_bond_nics
Line 320: return available_bonds
Line 321: 
Line 322: 
Line 323: def _wait_for_all_devices_up(links):
> I think you need to continue checking 'mon' in a loop until either all link
I vote for simplicity. This code runs only once during boot. No need to 
optimize it with test-acquire-test.
Line 324: try:
Line 325: with monitor.Monitor(groups=('link',), timeout=5) as mon:
Line 326: down_links = _get_links_with_state_down(links)
Line 327: logging.debug("waiting for %s to be up.", down_links)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-25 Thread edwardh
Edward Haas has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/53968/3/vdsm/vdsm-restore-net-config
File vdsm/vdsm-restore-net-config:

Line 319: available_bonds[bond]['nics'] = available_bond_nics
Line 320: return available_bonds
Line 321: 
Line 322: 
Line 323: def _wait_for_all_devices_up(links):
> I think you need to continue checking 'mon' in a loop until either all link
I just realized that iterating over mon is a blocking operation, no need for a 
loop. Sorry.
Line 324: try:
Line 325: with monitor.Monitor(groups=('link',), timeout=5) as mon:
Line 326: down_links = _get_links_with_state_down(links)
Line 327: logging.debug("waiting for %s to be up.", down_links)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-25 Thread edwardh
Edward Haas has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3: Code-Review-1

(1 comment)

https://gerrit.ovirt.org/#/c/53968/3/vdsm/vdsm-restore-net-config
File vdsm/vdsm-restore-net-config:

Line 319: available_bonds[bond]['nics'] = available_bond_nics
Line 320: return available_bonds
Line 321: 
Line 322: 
Line 323: def _wait_for_all_devices_up(links):
I think you need to continue checking 'mon' in a loop until either all links 
come up or a timeout event occurs.
Not sure why you directly stop mon, it is stooped when exiting the context 
manager.

And IMO, I think that you should check for links down twice, once before the 
monitoring (why create an mon object if not needed), and a second time after 
the monitor has been activated as you have done.
Line 324: try:
Line 325: with monitor.Monitor(groups=('link',), timeout=5) as mon:
Line 326: down_links = _get_links_with_state_down(links)
Line 327: logging.debug("waiting for %s to be up.", down_links)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-24 Thread Jenkins CI
Jenkins CI has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3: Continuous-Integration+1

Propagate review hook: Continuous Integration value inherited from patch 2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-24 Thread phoracek
Petr Horáček has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3: Verified+1

I tested the function manually on a bridge. When the bridge was DOWN, the 
function exited and logged after 5 secs. When i turned the bridge UP while 
waiting, the function returned.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-24 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 3:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 
'ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-24 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 2:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 
'ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-24 Thread osvoboda
Ondřej Svoboda has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-24 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..


Patch Set 1:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 
'ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: vdsm-restore-net-config: wait for links with netlink monitor

2016-02-24 Thread phoracek
Petr Horáček has uploaded a new change for review.

Change subject: vdsm-restore-net-config: wait for links with netlink monitor
..

vdsm-restore-net-config: wait for links with netlink monitor

Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Signed-off-by: Petr Horáček 
---
M vdsm/vdsm-restore-net-config
1 file changed, 22 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/53968/1

diff --git a/vdsm/vdsm-restore-net-config b/vdsm/vdsm-restore-net-config
index a64f7ce..3515f9a 100755
--- a/vdsm/vdsm-restore-net-config
+++ b/vdsm/vdsm-restore-net-config
@@ -25,7 +25,6 @@
 import os
 import re
 import threading
-import time
 import errno
 
 import six
@@ -35,12 +34,12 @@
 from vdsm.netinfo import nics, misc
 from vdsm.netinfo.misc import ipv6_supported
 from vdsm.netinfo.cache import CachingNetInfo
+from vdsm.netlink import monitor
 from vdsm import kernelconfig
 from vdsm.constants import P_VDSM_RUN
 from vdsm.netconfpersistence import RunningConfig, PersistentConfig, \
 CONF_PERSIST_DIR, BaseConfig
 from vdsm import sysctl
-from vdsm.utils import monotonic_time
 import hostdev
 
 # Ifcfg persistence restoration
@@ -49,8 +48,6 @@
 # Unified persistence restoration
 from vdsm.network.api import setupNetworks, change_numvfs
 
-
-_ALL_DEVICES_UP_TIMEOUT = 5
 
 _NETS_RESTORED_MARK = os.path.join(P_VDSM_RUN, 'nets_restored')
 _VIRTUAL_FUNCTIONS_PATH = os.path.join(CONF_PERSIST_DIR, 'virtual_functions')
@@ -324,20 +321,27 @@
 
 
 def _wait_for_for_all_devices_up(links):
-timeout = monotonic_time() + _ALL_DEVICES_UP_TIMEOUT
-down_links = _get_links_with_state_down(links)
-
-# TODO: use netlink monitor here might be more elegant (not available in
-# TODO: 3.5)
-while down_links and monotonic_time() < timeout:
-logging.debug("waiting for %s to be up.", down_links)
-time.sleep(1)
-down_links = _get_links_with_state_down(links)
-
-if down_links:
-logging.warning("Not all devices are up. VDSM might restore them "
-"although they were not changed since they were "
-"persisted.")
+try:
+with monitor.Monitor(groups=('link',), timeout=5) as mon:
+down_links = _get_links_with_state_down(links)
+logging.debug("waiting for %s to be up.", down_links)
+if not down_links:
+mon.stop()
+for event in mon:
+link_name = event.get('label')
+if (link_name in down_links and
+event.get('event') == 'new_link' and
+event.get('state') == 'up'):
+down_links.remove(link_name)
+if not down_links:
+mon.stop()
+except monitor.MonitorError as e:
+if e[0] == monitor.E_TIMEOUT:
+logging.warning("Not all devices are up. VDSM might restore them "
+"although they were not changed since they were "
+"persisted.")
+else:
+raise
 else:
 logging.debug("All devices are up.")
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c45430925a55bb54995b91a061bc15affe15763
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches