add git-add-lines.sh, vm-common.sh scripts
authorColin Patrick Mccabe <cmccabe@alumni.cmu.edu>
Tue, 20 Aug 2013 21:50:30 +0000 (14:50 -0700)
committerColin Patrick Mccabe <cmccabe@alumni.cmu.edu>
Tue, 20 Aug 2013 21:51:21 +0000 (14:51 -0700)
git-add-lines.sh [new file with mode: 0755]
vm-common.sh

diff --git a/git-add-lines.sh b/git-add-lines.sh
new file mode 100755 (executable)
index 0000000..8283402
--- /dev/null
@@ -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
index 2c57b05..ba0f77a 100644 (file)
@@ -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):