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 archs="$(uname -i)+$TARGET_ARCH"
27 i386+i386) QEMU=qemu;;
28 i386+x86_64) QEMU=qemu-system-x86_64;;
29 x86_64+i386) QEMU=qemu;;
30 x86_64+x86_64) QEMU=qemu-system-x86_64;;
33 #Creating new HDA if needed only
34 #using qcow2 disk image format which is essential to support VM snapshots
36 echo "Using existing $HDA"
38 echo -n "Creating hard disk image (${DISK_SIZE}) as $HDA .. "
39 img=$($QEMU_CREATE_IMAGE)
49 #Command for running the Qemu Emulator
50 ARGS="-boot d -net nic,macaddr=${MACADDR} -net $TAP, -cdrom ${NODE_ISO} -hda ${HDA} -m ${RAM} -nographic -pidfile qemu.pid"
51 echo "Running $QEMU $ARGS < /dev/null"
52 exec $QEMU $ARGS < /dev/null