aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/poky-qemu
diff options
context:
space:
mode:
authorZhai Edwin <edwin.zhai@intel.com>2010-12-02 15:11:53 +0800
committerSaul Wold <sgw@linux.intel.com>2010-12-09 08:18:18 -0800
commita1175b89066dbea7ab6783ac68e9b2ce98b326b0 (patch)
treed0fdd9e46a87c3c0c8e179ece0959e52d364a36b /scripts/poky-qemu
parent3d08b9f2c65835822b1c0ed30e3170f02f877ce3 (diff)
downloadopenembedded-core-contrib-a1175b89066dbea7ab6783ac68e9b2ce98b326b0.tar.gz
qemu: Enable KVM support on x86/x86-64 host
User need build kvm module for native kernel and install them by "modprobe kvm_intel". Then add "kvm" option to poky-qemu to enable it. Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Diffstat (limited to 'scripts/poky-qemu')
-rwxr-xr-xscripts/poky-qemu12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/poky-qemu b/scripts/poky-qemu
index 67af439ea9..bfeefc7085 100755
--- a/scripts/poky-qemu
+++ b/scripts/poky-qemu
@@ -84,6 +84,7 @@ process_filename() {
# Parse command line args without requiring specific ordering. It's a
# bit more complex, but offers a great user experience.
+KVM_ENABLED="no"
i=1
while [ $i -le $# ]; do
arg=${!i}
@@ -124,6 +125,10 @@ while [ $i -le $# ]; do
SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio"
SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
;;
+ "kvm")
+ KVM_ENABLED="yes"
+ KVM_CAPABLE=`grep 'vmx\|smx' /proc/cpuinfo`
+ ;;
*)
# A directory name is an nfs rootfs
if [ -d "$arg" ]; then
@@ -152,6 +157,13 @@ while [ $i -le $# ]; do
i=$((i + 1))
done
+# Detect KVM configuration
+if [[ "x$KVM_ENABLED" == "xyes" && ! -z "$KVM_CAPABLE" ]]; then
+ if [[ "x$MACHINE" == "xqemux86" || "x$MACHINE" == "xqemux86-64" ]]; then
+ SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm"
+ fi
+fi
+
# Report errors for missing combinations of options
if [[ -z "$MACHINE" && -z "$KERNEL" ]]; then
echo "Error: you must specify at least a MACHINE or KERNEL argument"