diff options
-rw-r--r-- | tools/examples/xend-config.sxp | 19 | ||||
-rw-r--r-- | tools/hotplug/Linux/network-bridge | 8 |
2 files changed, 25 insertions, 2 deletions
diff --git a/tools/examples/xend-config.sxp b/tools/examples/xend-config.sxp index 7ab7eb8f38..b7e98f464d 100644 --- a/tools/examples/xend-config.sxp +++ b/tools/examples/xend-config.sxp @@ -147,8 +147,22 @@ # # (network-script 'network-bridge netdev=eth1') # -# The bridge is named xenbr0, by default. To rename the bridge, use +# The bridge is named eth0, by default (yes, really!) # + +# It is normally much better to create the bridge yourself in +# /etc/network/interfaces. network-bridge start does nothing if you +# already have a bridge, and network-bridge stop does nothing if the +# default bridge name (normally eth0) is not a bridge. See +# bridge-utils-interfaces(5) for full information on the syntax in +# /etc/network/interfaces, but you probably want something like this: +# iface xenbr0 inet static +# address [etc] +# netmask [etc] +# [etc] +# bridge_ports eth0 +# +# To have network-bridge create a differently-named bridge, use: # (network-script 'network-bridge bridge=<name>') # # It is possible to use the network-bridge script in more complicated @@ -169,7 +183,8 @@ # configuring a new vif, but a value specified here would act as a default. # # If you are using only one bridge, the vif-bridge script will discover that, -# so there is no need to specify it explicitly. +# so there is no need to specify it explicitly. The default is to use +# the bridge which is listed first in the output from brctl. # (vif-script vif-bridge) diff --git a/tools/hotplug/Linux/network-bridge b/tools/hotplug/Linux/network-bridge index 070a9f9feb..035a58d8e2 100644 --- a/tools/hotplug/Linux/network-bridge +++ b/tools/hotplug/Linux/network-bridge @@ -216,6 +216,10 @@ op_start () { return fi + if [ `brctl show | wc -l` != 1 ]; then + return + fi + if link_exists "$pdev"; then # The device is already up. return @@ -264,6 +268,10 @@ op_stop () { if ! link_exists "$bridge"; then return fi + if ! [ -e "/sys/class/net/${bridge}/brif/${pdev}" ]; then + # $bridge is not a bridge to which pdev is enslaved + return + fi claim_lock "network-bridge" |