reorganize the qemu configuration template file
authorTony Mack <tmack@cs.princeton.edu>
Tue, 22 Jan 2008 11:24:41 +0000 (11:24 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Tue, 22 Jan 2008 11:24:41 +0000 (11:24 +0000)
system/TestNode.py
system/template-Qemu/env-qemu [moved from system/env-qemu with 100% similarity]
system/template-Qemu/qemu-ifup [moved from system/qemu-ifup with 100% similarity]
system/template-Qemu/start-qemu-node [new file with mode: 0644]

index 7924798..18b4239 100644 (file)
@@ -102,6 +102,6 @@ class TestNode:
         display=options.display
         utils.header('Starting vmplayer for node %s on %s'%(hostname,display))
         utils.system('cd %s/vmplayer-%s ; DISPLAY=%s vmplayer node.vmx < /dev/null >/dev/null 2>/dev/null &'%(path,hostname,display))
-
+        
     def start_qemu (self, options):
         utils.header ("TestNode.start_qemu: not implemented yet")
diff --git a/system/template-Qemu/start-qemu-node b/system/template-Qemu/start-qemu-node
new file mode 100644 (file)
index 0000000..adec717
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+#Default Value
+set $(pwd)
+NODE_DIR=$1
+shift $(($# -1))
+CDROM_IMG=${NODE_DIR}/boot_file.iso
+HDA=$NODE_DIR/hda_5.raw;       
+
+#Getting the MAC address
+if [ ! -e "$NODE_DIR/MAC" ];then
+    echo "File for MAC Address not found"
+    exit 1
+fi
+set $(cat $NODE_DIR/MAC)
+MACADDR=$1
+shift $(($# -1))
+
+# qemu parameters
+RAM=320;
+TAP="tap,script=${NODE_DIR}/qemu-ifup.sh";
+echo $NODE_DIR
+#check for the creation of new HDA
+if [ -e "$HDA" ]; then
+    echo "Disk already existing removing  it..."
+    rm -rf $HDA
+fi
+qemu-img create $HDA 5G
+echo "New $HDA is created..."
+
+#Command for running the Qemu Emulator
+ARGS="-boot d -cdrom ${CDROM_IMG} -hda ${HDA} -m ${RAM} -net nic,macaddr=${MACADDR} -net $TAP ";
+echo "Executing qemu $ARGS";
+qemu $ARGS
+
+
+exit
\ No newline at end of file