|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 2 of 2] tools/hotplug/Linux: read script for tapX.Y d
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1299232872 0
# Node ID 37b2d5372baab8b2fac860f9a9fff7348f74153c
# Parent 61357fd45fd75880c2683fdc643bf2563659e37e
tools/hotplug/Linux: read script for tapX.Y devices from xenstore.
This variable is not present in the $environment for tap hotplug events
in the way it is for vif hotplug events. Therefore we need to look up
the script in xenbus.
vif-common.sh already takes care of most of the environmental
differences but we need the script much earlier.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r 61357fd45fd7 -r 37b2d5372baa tools/hotplug/Linux/vif-setup
--- a/tools/hotplug/Linux/vif-setup Fri Mar 04 10:01:12 2011 +0000
+++ b/tools/hotplug/Linux/vif-setup Fri Mar 04 10:01:12 2011 +0000
@@ -1,4 +1,18 @@
#!/bin/bash
+
+# tap devices do not get the same environment as vif devices so we may
+# need to discover the script from xenbus.
+#
+# Try and only match the tap<domid>.<devid> naming scheme which Xen
+# uses, to avoid interfering with other uses of tap devices.
+if [ -z "$script" ] && echo $* | grep -qw type_if=tap ; then
+ xbpath=$(echo ${INTERFACE} | sed -ne
's,tap\([0-9][0-9]\?\)\.\([0-9][0-9]\?\),backend/vif/\1/\2,p')
+ if [ -n "$xbpath" ] ; then
+ script=`xenstore-read "${xbpath}/script"`
+ fi
+
+ export script
+fi
if test "$script"
then
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|