]> gitweb.fluxo.info Git - kvm-manager.git/commitdiff
Make the bridge name a variable
authorMatthew James Goins <mjg2203@columbia.edu>
Thu, 22 Jan 2015 17:11:33 +0000 (12:11 -0500)
committerMatthew James Goins <mjg2203@columbia.edu>
Thu, 22 Jan 2015 17:11:33 +0000 (12:11 -0500)
kvm-manager

index a8c7f9d4d6e798ead52a1d46b5d74fca0e532113..321bcb5707163c8666bd4948f2a5df2ac230c4d7 100755 (executable)
@@ -19,6 +19,7 @@ fi
 TAP="${TAP:-${VMNAME}0}"
 # MAC address is derived from a hash of the host's name and the guest's name:
 MAC="${MAC:-$(printf "02:%s" "$(printf "%s\0%s" "$(hostname)" "${VMNAME}" | sha256sum | sed 's/\(..\)/\1:/g' | cut -f1-5 -d:)" )}"
+BRIDGE="${BRIDGE:-br0}"
 
 ###################
 OWNERGROUP=$(groups "$OWNER" | cut -f1 -d\  )
@@ -29,7 +30,7 @@ up() {
     modprobe -v tun
     ip tuntap add dev "$TAP" mode tap user "$OWNER"
     ip link set "$TAP" up
-    brctl addif br0 "$TAP"
+    brctl addif $BRIDGE "$TAP"
     
     chpst -u "$OWNER:$OWNERGROUP" mkdir -p "$OWNERHOME/vms/$VMNAME"
 
@@ -132,7 +133,7 @@ EOF
 
 
 down() {
-    brctl delif br0 "$TAP"
+    brctl delif $BRIDGE "$TAP"
     ip link set "$TAP" down
     ip tuntap del mode tap dev "$TAP"
 # no need to lock up the block device as well, since the owner might