From: Colin Patrick Mccabe Date: Tue, 20 Aug 2013 21:50:30 +0000 (-0700) Subject: add git-add-lines.sh, vm-common.sh scripts X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8aaaa1a338e5684a76827a30f4ea7af810ff0e4;p=cmccabe-bin add git-add-lines.sh, vm-common.sh scripts --- diff --git a/git-add-lines.sh b/git-add-lines.sh new file mode 100755 index 0000000..8283402 --- /dev/null +++ b/git-add-lines.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# +# git add a bunch of lines, possibly after stripping off a leading pound sign +# + +sed 's/#//g' | sed 's/^[\t ]*\([^\t ]*\)[\t ]*$/\1/' | ql.sh | xargs -l git add diff --git a/vm-common.sh b/vm-common.sh index 2c57b05..ba0f77a 100644 --- a/vm-common.sh +++ b/vm-common.sh @@ -15,16 +15,25 @@ run_vm() { echo "running qemu with ssh port $ADMIN_PORT, vnc ID $ID" VNC_EFFECTIVE_PORT=`expr 5900 + $ID` echo "see output with vncviewer 127.0.0.1:$VNC_EFFECTIVE_PORT" - qemu-kvm \ + model_to_use=${NET_MODEL-e1000} + num_interfaces_to_use=${NUM_INTERFACES-2} + if [ $num_interfaces_to_use -eq 2 ]; then + SECOND_NET_SWITCHES="-net nic,vlan=1,macaddr=$MAC_ADDR,model=$model_to_use \ + -net socket,vlan=1,mcast=230.0.0.1:1234" + else + SECOND_NET_SWITCHES="" + fi + QEMU_VARIANT=${QEMU_VARIANT-qemu-kvm} + ${QEMU_VARIANT} \ -daemonize \ -vga std \ -redir tcp:$ADMIN_PORT::22 \ - -vnc 127.0.0.1:$ID \ - -net nic,vlan=0,model=e1000 \ + -net nic,vlan=0,model=$model_to_use \ -net user,vlan=0,net=10.0.2.0/8,host=10.0.2.2,hostname=vm$ID \ - -net nic,vlan=1,macaddr=$MAC_ADDR,model=e1000 \ - -net socket,vlan=1,mcast=230.0.0.1:1234 \ + -vnc 127.0.0.1:$ID \ + $SECOND_NET_SWITCHES \ $NARGS || die "qemu invocation failed." + #-sdl -frame \ } # Tap stuff (currently unused):