]> scripts.mit.edu Git - xen.git/blob - qemu-ifup
Allow memory to balloon to 8GiB
[xen.git] / qemu-ifup
1 #!/bin/sh
2
3 #. /etc/rc.d/init.d/functions
4 #ulimit -c unlimited
5
6 echo 'config qemu network with xen bridge for ' $*
7
8 bridge=$2
9
10 #
11 # Old style bridge setup with netloop, used to have a bridge name
12 # of xenbrX, enslaving pethX and vif0.X, and then configuring
13 # eth0.
14 #
15 # New style bridge setup does not use netloop, so the bridge name
16 # is ethX and the physical device is enslaved pethX
17 #
18 # So if...
19 #
20 #   - User asks for xenbrX
21 #   - AND xenbrX doesn't exist
22 #   - AND there is a ethX device which is a bridge
23 #
24 # ..then we translate xenbrX to ethX
25 #
26 # This lets old config files work without modification
27 #
28 if [ ! -e "/sys/class/net/$bridge" ] && [ -z "${bridge##xenbr*}" ]
29 then
30    if [ -e "/sys/class/net/eth${bridge#xenbr}/bridge" ]
31    then
32       bridge="eth${bridge#xenbr}"
33    fi
34 fi
35
36 ifconfig $1 0.0.0.0 up
37 brctl addif $bridge $1 || true