File vif-route-ifup.patch of Package xen

Index: xen-4.0.2-testing/tools/hotplug/Linux/vif-route-ifup
===================================================================
--- /dev/null
+++ xen-4.0.2-testing/tools/hotplug/Linux/vif-route-ifup
@@ -0,0 +1,34 @@
+#!/bin/bash
+#============================================================================
+# /etc/xen/vif-route-ifup
+#
+# Script for configuring a vif in routed mode.
+# The hotplugging system will call this script if it is specified either in
+# the device configuration given to Xend, or the default Xend configuration
+# in /etc/xen/xend-config.sxp.  If the script is specified in neither of those
+# places, then vif-bridge is the default.
+#
+# Usage:
+# vif-route-ifup (add|remove|online|offline)
+#
+# Environment vars:
+# vif         vif interface name (required).
+#============================================================================
+
+dir=$(dirname "$0")
+. "$dir/vif-common.sh"
+
+case "$command" in
+    online)
+        ifup ${vif}
+        ;;
+    offline)
+        do_without_error ifdown ${vif}
+        ;;
+esac
+
+log debug "Successful vif-route-ifup $command for $vif."
+if [ "$command" = "online" ]
+then
+  success
+fi
Index: xen-4.0.2-testing/tools/examples/xend-config.sxp
===================================================================
--- xen-4.0.2-testing.orig/tools/examples/xend-config.sxp
+++ xen-4.0.2-testing/tools/examples/xend-config.sxp
@@ -184,6 +184,26 @@
 #(network-script network-route)
 #(vif-script     vif-route)
 
+# SuSE users note:
+# If using a routed network configuration it is advised to NOT use
+# network-route and vif-route scripts but instead use sysconfig scripts
+# in dom0 and vif-route-ifup script to "connect" the domU vif to dom0.
+# Since this configuration requires a vif sysconfig script in dom0, a static
+# vif name must be used.  E.g. in dom0 the vif sysconfig script
+# (/etc/sysconfig/network/ifcfg-xen1.0) may contain
+#
+#    NAME='XEN vm 1 virtual interface 0'
+#    BOOTPROTO='static'
+#    STARTMODE='hotplug'
+#    ...
+#
+# The corresponding domain vif configuration would contain e.g.
+# vif=[ 'mac=00:16:3e:aa:bb:cc,script=vif-route-ifup,vifname=xen1.0', ]
+#
+# If the vif-route-ifup script will be used for all domains, it can be
+# set here as the default vif script, alleviating the need for
+# 'script=' in domain vif configuration.
+#(vif-script     vif-route-ifup)
 
 ## Use the following if network traffic is routed with NAT, as an alternative
 # to the settings for bridged networking given above.
Index: xen-4.0.2-testing/tools/hotplug/Linux/Makefile
===================================================================
--- xen-4.0.2-testing.orig/tools/hotplug/Linux/Makefile
+++ xen-4.0.2-testing/tools/hotplug/Linux/Makefile
@@ -10,7 +10,7 @@ XENDOMAINS_SYSCONFIG = init.d/sysconfig.
 
 # Xen script dir and scripts to go there.
 XEN_SCRIPTS = network-bridge vif-bridge
-XEN_SCRIPTS += network-route vif-route
+XEN_SCRIPTS += network-route vif-route vif-route-ifup
 XEN_SCRIPTS += network-nat vif-nat
 XEN_SCRIPTS += vif2
 XEN_SCRIPTS += block
openSUSE Build Service is sponsored by