diff -u --recursive --new-file xen-4.1.0-vanilla/tools/hotplug/Linux/vif-bridge xen-4.1.0/tools/hotplug/Linux/vif-bridge --- xen-4.1.0-vanilla/tools/hotplug/Linux/vif-bridge 2011-05-06 10:39:15.848610384 -0500 +++ xen-4.1.0/tools/hotplug/Linux/vif-bridge 2011-05-09 11:47:03.247718082 -0500 @@ -105,6 +105,8 @@ handle_iptable fi +call_hooks vif post + log debug "Successful vif-bridge $command for $dev, bridge $bridge." if [ "$type_if" = vif -a "$command" = "online" ] then diff -u --recursive --new-file xen-4.1.0-vanilla/tools/hotplug/Linux/vif-nat xen-4.1.0/tools/hotplug/Linux/vif-nat --- xen-4.1.0-vanilla/tools/hotplug/Linux/vif-nat 2011-05-06 10:39:15.847610424 -0500 +++ xen-4.1.0/tools/hotplug/Linux/vif-nat 2011-05-09 11:47:11.815394984 -0500 @@ -185,6 +185,8 @@ handle_iptable +call_hooks vif post + log debug "Successful vif-nat $command for ${dev}." if [ "$command" = "online" ] then diff -u --recursive --new-file xen-4.1.0-vanilla/tools/hotplug/Linux/vif-post.d/00-vif-local.hook xen-4.1.0/tools/hotplug/Linux/vif-post.d/00-vif-local.hook --- xen-4.1.0-vanilla/tools/hotplug/Linux/vif-post.d/00-vif-local.hook 1969-12-31 18:00:00.000000000 -0600 +++ xen-4.1.0/tools/hotplug/Linux/vif-post.d/00-vif-local.hook 2011-05-09 11:21:12.438113611 -0500 @@ -0,0 +1,18 @@ +#============================================================================ +# ${XEN_SCRIPT_DIR}/vif-post.d/00-vif-local.hook +# +# Script for performing local configuration of a vif. +# This script will be sourced by, e.g., vif-bridge after the hotplugging +# system calls vif-bridge. The script is here and not simply executed as +# a udev rule because this allows simple access to several environment +# variables set by the calling vif-* script. +# +# Environment vars: +# command (add|remove|online|offline) +# dev vif interface name (required). +# main_ip IP address of Dom0 +# ip list of IP networks for the vif, space-separated +# XENBUS_PATH path to this device's details in the XenStore (required). +#============================================================================ + +# Place local modifications here. diff -u --recursive --new-file xen-4.1.0-vanilla/tools/hotplug/Linux/vif-route xen-4.1.0/tools/hotplug/Linux/vif-route --- xen-4.1.0-vanilla/tools/hotplug/Linux/vif-route 2011-05-06 10:39:15.845610504 -0500 +++ xen-4.1.0/tools/hotplug/Linux/vif-route 2011-05-09 11:46:57.408939221 -0500 @@ -49,6 +49,8 @@ handle_iptable +call_hooks vif post + log debug "Successful vif-route ${command} for ${dev}." if [ "${command}" = "online" ] then diff -u --recursive --new-file xen-4.1.0-vanilla/tools/hotplug/Linux/xen-hotplug-common.sh xen-4.1.0/tools/hotplug/Linux/xen-hotplug-common.sh --- xen-4.1.0-vanilla/tools/hotplug/Linux/xen-hotplug-common.sh 2011-05-06 10:39:15.847610424 -0500 +++ xen-4.1.0/tools/hotplug/Linux/xen-hotplug-common.sh 2011-05-09 11:43:09.239663639 -0500 @@ -99,4 +99,15 @@ _xenstore_write "$@" || fatal "Writing $@ to xenstore failed." } +## +# call_hooks +# +# Execute each hook in the directory. +# +call_hooks() { + for f in /etc/xen/scripts/${1}-${2}.d/*.hook; do + [ -x "$f" ] && . "$f" + done +} + log debug "$@" "XENBUS_PATH=$XENBUS_PATH"