ia64/xen-unstable

view tools/hotplug/Linux/block-nbd @ 19497:2f6ed9318c03

network-bridge: Fix do_ifup in the case of ${bridge} != ${netdev}

On RHEL5.2, ifup ${bridge} fails if ${bridge} != ${netdev},
because RHEL5.2's ifup ${bridge} runs the following sequence:

1. Search CONFIG that has the same mac address of ${bridge}.=20
ifcfg-${netdev} is found.
2. Run "ip link set dev ${netdev} up".
# ${bridge} is expected.
3. Output "Failed to bring up ${netdev}."
Because ${netdev} does not exist.

Thus, do_ifup() should not use ifup if ${bridge} != ${netdev}.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 02 11:48:10 2009 +0100 (2009-04-02)
parents 4bfc67b09e9c
children
line source
1 #!/bin/bash
3 # Usage: block-nbd [bind server ctl_port |unbind node]
4 #
5 # The node argument to unbind is the name of the device node we are to
6 # unbind.
7 #
8 # This assumes you're running a correctly configured server at the other end!
10 dir=$(dirname "$0")
11 . "$dir/block-common.sh"
13 case "$command" in
14 add)
15 for dev in /dev/nbd*; do
16 if nbd-client $2 $3 $dev; then
17 write_dev $dev
18 exit 0
19 fi
20 done
21 exit 1
22 ;;
23 remove)
24 nbd-client -d $2
25 exit 0
26 ;;
27 esac