direct-io.hg

changeset 11224:b688d4a68a3e

Make add_to_bridge() always leave the device up even when it bails out due to the device already being present on the bridge.
This makes the script more idempotent if run twice (e.g. from hotplug and udev), since the second time the device will be taken down and not brought up again, leaving the host without networking.

Signed-off-by: Anil Madhavapeddy <anil@xensource.com>
author Anil Madhavapeddy <anil@xensource.com>
date Tue Aug 22 14:59:16 2006 +0100 (2006-08-22)
parents a4550b748840
children d3a9bcf61c33
files tools/examples/xen-network-common.sh
line diff
     1.1 --- a/tools/examples/xen-network-common.sh	Tue Aug 22 12:20:43 2006 +0100
     1.2 +++ b/tools/examples/xen-network-common.sh	Tue Aug 22 14:59:16 2006 +0100
     1.3 @@ -143,6 +143,7 @@ add_to_bridge () {
     1.4  
     1.5      # Don't add $dev to $bridge if it's already on a bridge.
     1.6      if [ -e "/sys/class/net/${bridge}/brif/${dev}" ]; then
     1.7 +	ip link set ${dev} up || true
     1.8  	return
     1.9      fi
    1.10      brctl addif ${bridge} ${dev}