|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2/2] tools/hotplug, Use udev rules instead of qemu script to setup the bridge.
Stefano Stabellini wrote: On Wed, 4 Aug 2010, anthony.perard@xxxxxxxxxx wrote:From: Anthony PERARD <anthony.perard@xxxxxxxxxx> This patch adds a second argument to vif-bridge script. It can be "vif" or "tap". "vif" give the default behavior and "tap" just add the interface to the found bridge when the action is "add". Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx> --- tools/hotplug/Linux/vif-bridge | 42 +++++++++++++++++++++++++++----- tools/hotplug/Linux/vif-common.sh | 12 ++++++--- tools/hotplug/Linux/xen-backend.rules | 5 ++- tools/libxl/libxl.c | 4 +- 4 files changed, 48 insertions(+), 15 deletions(-) diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge index d35144e..63223f3 100644 --- a/tools/hotplug/Linux/vif-bridge +++ b/tools/hotplug/Linux/vif-bridge @@ -29,6 +29,13 @@ # rules for its ip addresses (if any). #============================================================================+# Older versions of Xen do not pass in the type as an argument+if [ $# -lt 2 ]; then + type_if=vif +else + type_if=$2 +fi + dir=$(dirname "$0") . "$dir/vif-common.sh"@@ -79,22 +86,43 @@ then The command come directly from the $ACTION in udev, and for some reason, this event is different in both cases. Here, I just check if we really want to setup a vif or a tap. This is too much? I can check the argument before that, in vif-common.sh, like is already done for a vif. -handle_iptable+if [ "$type_if" = vif ]; then + handle_iptable +fiwhy is handle_iptable only called with vifs? Because iptable wasn't handled before with the qemu script and it doesn't seem to be necessary to handle iptable for a tap device. -log debug "Successful vif-bridge $command for $vif, bridge $bridge." -if [ "$command" == "online" ] +log debug "Successful vif-bridge $command for $dev, bridge $bridge." +if [ "$type_if" = vif -a "$command" = "online" ] then success fi diff --git a/tools/hotplug/Linux/vif-common.sh b/tools/hotplug/Linux/vif-common.sh index 44dd342..4cf00c0 100644 --- a/tools/hotplug/Linux/vif-common.sh +++ b/tools/hotplug/Linux/vif-common.sh @@ -33,7 +33,9 @@ ficase "$command" in The interface name is get from $INTERFACE, and the bridge is found automatically by the script. But there must be a way to take the bridge from xenstore, by using the name of the device (tap32.0) to have the path. -- Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |