[node-patches] Change in ovirt-node[master]: init: Fix link detection for auto-installation

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Oct 24 10:43:06 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/03/20503/1

diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index c4280ca..2ad68cf 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -430,6 +430,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"
@@ -438,6 +440,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/20503
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72307c6ea53002014c680087166e8a64745dd3fd
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list