3 # cd in this command's directory
9 HDA=hdd-cow2-${DISK_SIZE}.img
10 QEMU_CREATE_IMAGE="qemu-img create -f qcow2 $HDA ${DISK_SIZE}"
13 TAP="tap,script=$SCRIPT"
15 ########## from the test environment
16 # expected vars are MACADDR, NODE_ISO, HOSTNAME and TARGET_ARCH
18 if [ ! -e ${CONFIG} ];then
19 echo "File for node_iso version not found"
24 # the launcher, depending on local/target archs
25 # make sure to check qemu-kill-node for consistency
26 archs="$(uname -i)+$TARGET_ARCH"
28 i386+i386) QEMU=qemu;;
29 i386+x86_64) QEMU=qemu-system-x86_64;;
30 x86_64+i386) QEMU=qemu;;
31 x86_64+x86_64) QEMU=qemu-system-x86_64;;
34 #Creating new HDA if needed only
35 #using qcow2 disk image format which is essential to support VM snapshots
37 echo "Using existing $HDA"
39 echo -n "Creating hard disk image (${DISK_SIZE}) as $HDA .. "
40 img=$($QEMU_CREATE_IMAGE)
50 #Command for running the Qemu Emulator
51 ARGS="-boot d -net nic,macaddr=${MACADDR} -net $TAP, -cdrom ${NODE_ISO} -hda ${HDA} -m ${RAM} -nographic -pidfile qemu.pid"
52 echo "Running $QEMU $ARGS < /dev/null"
53 exec $QEMU $ARGS < /dev/null