[node-patches] Change in ovirt-node[node-3.0]: init: Fix link detection for auto-installation
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Fri Oct 25 10:45:34 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: init: Fix link detection for auto-installation
......................................................................
init: Fix link detection for auto-installation
The link state of a device needs to be detected when BOOTIF=link is
given on an auto-install.
Previously the link state of a device was determined in one pass. This
could lead to problems when it takes the hardware a while to initialize
or at least set the link state to UP.
Now five (5) passes are allowed to find a device with a link.
Change-Id: I72307c6ea53002014c680087166e8a64745dd3fd
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=959957
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/ovirt-init-functions.sh.in
1 file changed, 13 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/47/20547/1
diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 49d0681..77b45b9 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -407,6 +407,8 @@
bootif=$i
;;
link)
+ bootif=
+ for trial in $(seq 1 5); do
for eth in $(cd /sys/class/net; echo [ep]*); do
ip link set dev $eth up
if ethtool $eth 2>/dev/null|grep -q "Link detected: yes"
@@ -415,6 +417,17 @@
break
fi
done
+ if [ "x$bootif" == "x" ]; then
+ log "INFO: Failed to detect link on any device in the $trial pass."
+ sleep 1
+ if [ $trial -eq 5 ]; then
+ log "WARNING: Failed to detect link on device. Auto-install fails."
+ fi
+ else
+ log "INFO: Detected a link on device $bootif."
+ break
+ fi
+ done
;;
??-??-??-??-??-??-??)
i=${i#??-}
--
To view, visit http://gerrit.ovirt.org/20547
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I72307c6ea53002014c680087166e8a64745dd3fd
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: node-3.0
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list