#!/bin/bash
-# $Id$
+# Thierry Parmentelat <thierry.parmentelat@inria.fr>
+# Copyright (C) 2010 INRIA
+#
# it does the following:
# (*) close all file descriptors and redirect output to log.txt
# this is because it is designed for use through ssh from a remote test master controller
[ -f "$CONFIG" ] || { echo "Config file for qemu $CONFIG not found in $(pwd)" ; exit 1 ; }
. $CONFIG
+# NOTE: check if the machine supports 64bits. We'll add -no-kqemu only
+# if it does. On 32bits host, qemu-system-x86_64 doesn't accept this
+# parameter (although it's there in the man page)
+function is_64bits () {
+ return $(cat /proc/cpuinfo | grep "^flags" | grep " lm " > /dev/null)
+}
+
+
# the launcher, depending on target arch
# make sure to check qemu-kill-node for consistency
case $TARGET_ARCH in
i386) QEMU=qemu ; ARGS="" ;;
- x86_64) QEMU=qemu-system-x86_64 ; ARGS="-no-kqemu" ;;
+ x86_64) QEMU=qemu-system-x86_64 ; if is_64bits; then ARGS="-no-kqemu"; else ARGS=""; fi ;;
*) echo "Cannot handle TARGET_ARCH=$TARGET_ARCH"; exit 1 ;;
esac
echo "Done"
fi
+echo 'Trying to load the kqemu module'
+if modprobe kqemu &> /dev/null ; then
+ echo "kqemu loaded"
+else
+ echo "WARNING : Could not modprobe kqemu"
+fi
+
echo 'Checking for a loaded kqemu module'
lsmod | grep kqemu
echo 'Checking for /dev/kqemu'
ARGS="$ARGS -hda ${DISK_IMAGE}"
ARGS="$ARGS -nographic"
ARGS="$ARGS -pidfile qemu.pid"
-# how many pysical procs have we got, run in smp mode if possible
-procs=$(grep -i mhz /proc/cpuinfo | wc -l )
-if (( $procs >= 2 )) ; then ARGS="$ARGS -smp 2" ; fi
# boot from CD
ARGS="$ARGS -boot d"
ARGS="$ARGS -cdrom ${NODE_ISO}"