Whoops, that patch is obviously missing an extra line containing a fi
statement. Fixed version attached. And configurating is obviously not
english. :)

-- 
Hans van Kranenburg - System / Network Engineer
T +31 (0)10 2760434 | [email protected] | www.mendix.com
--- vif-common.sh.orig  2012-02-01 22:59:38.591413942 +0100
+++ vif-common.sh       2012-02-01 23:44:02.776438209 +0100
@@ -74,9 +74,19 @@
     vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "")
     if [ "$vifname" ]
     then
-        if [ "$command" == "online" ] && ! ip link show "$vifname" >&/dev/null
+        if [ "$command" == "online" ]
         then
-            do_or_die ip link set "$dev" name "$vifname"
+            # if a custom vifname was chosen and a link with that desired name
+            # already exists, then stop, before messing up whatever is using
+            # that interface (e.g. another running domU) because it's likely a
+            # configuration error
+            if ip link show "$vifname" >&/dev/null
+            then
+                fatal "Cannot rename interface $dev. An interface with name \
+                    $vifname already exists."
+            else
+                do_or_die ip link set "$dev" name "$vifname"
+            fi
         fi
         dev="$vifname"
     fi

Reply via email to