WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tools/hotplug: support vif-post.d hook ar

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/hotplug: support vif-post.d hook arrangements
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 16 Jun 2011 11:11:48 +0100
Delivery-date: Thu, 16 Jun 2011 03:16:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User W. Michael Petullo <mike@xxxxxxxx>
# Date 1306316724 -3600
# Node ID a44b12ee2fd37a66a616a1b93a6aa2f8bbb25f90
# Parent  6d4b7530cee105a4f0f35c6d90ff9a5ede4f59e0
tools/hotplug: support vif-post.d hook arrangements

New feature: you can drop hook scripts into
 /etc/xen/scripts/vif-post.d/*.hook

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 6d4b7530cee1 -r a44b12ee2fd3 tools/hotplug/Linux/vif-bridge
--- a/tools/hotplug/Linux/vif-bridge    Tue May 24 18:33:06 2011 +0100
+++ b/tools/hotplug/Linux/vif-bridge    Wed May 25 10:45:24 2011 +0100
@@ -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 -r 6d4b7530cee1 -r a44b12ee2fd3 tools/hotplug/Linux/vif-nat
--- a/tools/hotplug/Linux/vif-nat       Tue May 24 18:33:06 2011 +0100
+++ b/tools/hotplug/Linux/vif-nat       Wed May 25 10:45:24 2011 +0100
@@ -185,6 +185,8 @@
 
 handle_iptable
 
+call_hooks vif post
+
 log debug "Successful vif-nat $command for ${dev}."
 if [ "$command" = "online" ]
 then
diff -r 6d4b7530cee1 -r a44b12ee2fd3 
tools/hotplug/Linux/vif-post.d/00-vif-local.hook
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/hotplug/Linux/vif-post.d/00-vif-local.hook  Wed May 25 10:45:24 
2011 +0100
@@ -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 -r 6d4b7530cee1 -r a44b12ee2fd3 tools/hotplug/Linux/vif-route
--- a/tools/hotplug/Linux/vif-route     Tue May 24 18:33:06 2011 +0100
+++ b/tools/hotplug/Linux/vif-route     Wed May 25 10:45:24 2011 +0100
@@ -49,6 +49,8 @@
 
 handle_iptable
 
+call_hooks vif post
+
 log debug "Successful vif-route ${command} for ${dev}."
 if [ "${command}" = "online" ]
 then
diff -r 6d4b7530cee1 -r a44b12ee2fd3 tools/hotplug/Linux/xen-hotplug-common.sh
--- a/tools/hotplug/Linux/xen-hotplug-common.sh Tue May 24 18:33:06 2011 +0100
+++ b/tools/hotplug/Linux/xen-hotplug-common.sh Wed May 25 10:45:24 2011 +0100
@@ -99,4 +99,15 @@
   _xenstore_write "$@" || fatal "Writing $@ to xenstore failed."
 }
 
+##
+# call_hooks <devtype> <hook>
+#
+# Execute each hook in the <hook> directory.
+#
+call_hooks() {
+  for f in /etc/xen/scripts/${1}-${2}.d/*.hook; do
+    [ -x "$f" ] && . "$f"
+  done
+}
+
 log debug "$@" "XENBUS_PATH=$XENBUS_PATH"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/hotplug: support vif-post.d hook arrangements, Xen patchbot-unstable <=