3 #. /etc/rc.d/init.d/functions
6 echo 'config qemu network with xen bridge for ' $*
11 # Old style bridge setup with netloop, used to have a bridge name
12 # of xenbrX, enslaving pethX and vif0.X, and then configuring
15 # New style bridge setup does not use netloop, so the bridge name
16 # is ethX and the physical device is enslaved pethX
20 # - User asks for xenbrX
21 # - AND xenbrX doesn't exist
22 # - AND there is a ethX device which is a bridge
24 # ..then we translate xenbrX to ethX
26 # This lets old config files work without modification
28 if [ ! -e "/sys/class/net/$bridge" ] && [ -z "${bridge##xenbr*}" ]
30 if [ -e "/sys/class/net/eth${bridge#xenbr}/bridge" ]
32 bridge="eth${bridge#xenbr}"
36 ifconfig $1 0.0.0.0 up
37 brctl addif $bridge $1 || true