invirt-xen-config (0.0.45) unstable; urgency=low
* Neuter vif-setup (from xl, perhaps?)
+ * Update vif-invirtroute for Xen 4's scripts.
- -- Quentin Smith <quentin@mit.edu> Sun, 21 Jul 2013 14:23:30 -0400
+ -- Quentin Smith <quentin@mit.edu> Sun, 21 Jul 2013 14:28:58 -0400
invirt-xen-config (0.0.44) unstable; urgency=low
#!/bin/sh
-echo "config qemu network with xen bridge for $@"
+echo "config qemu network with invirtroute for $@"
if [ -z "$domid" ]; then
echo "domid is not set!!!" >&2
exit 1
fi
-dev=$1
+INTERFACE=$1
+type_if=tap
ifnum=${1##*.}
qemu_online=yes
-XENBUS_PATH=/local/domain/0/backend/vif/${domid}/${ifnum}
vif=vif${domid}.${ifnum}
-export vif qemu_online XENBUS_PATH dev
+export vif qemu_online INTERFACE type_if
-exec /etc/xen/scripts/vif-invirtroute online
+exec /etc/xen/scripts/vif-invirtroute add
dev=${dev:-${vif}}
case "$command" in
- online)
+ online|add)
ifconfig ${dev} ${main_ip} netmask 255.255.255.255 up
echo 1 >/proc/sys/net/ipv4/conf/${dev}/proxy_arp
echo 1 >/proc/sys/net/ipv4/conf/${dev}/rp_filter
ipcmd='add'
cmdprefix=''
;;
- offline)
+ offline|remove)
do_without_error ifdown ${vif}
ipcmd='del'
cmdprefix='do_without_error'
# the guest using those addresses.
for addr in ${ip} ; do
${cmdprefix} ip route ${ipcmd} ${addr} dev ${dev} src ${main_ip}
- if [ "$command" == "online" ]; then
- arpspoof -i $(invirt-getconf xen.iface) -t 18.181.0.1 ${addr}&
- sleep 5
- kill %arpspoof
- fi
+ case "$command" in
+ online|add)
+ arpspoof -i $(invirt-getconf xen.iface) -t 18.181.0.1 ${addr}&
+ sleep 5
+ kill %arpspoof
+ ;;
+ esac
done
fi
fi
log debug "Successful vif-route $command for $vif."
-if [ "$command" == "online" ]
-then
- success
-fi
+case "$command" in
+ online|add)
+ success
+ ;;
+esac