summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhai Edwin <edwin.zhai@intel.com>2010-12-22 21:22:24 +0800
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-23 14:28:22 +0000
commit983bd9a77e4afdb2890245653f39d6c6d093a655 (patch)
tree654fee2ef0cb1d05c0a18f6adcf0a7c840c0aaa6
parent3aa1cfc5a852f18208ee2afb535c1d05d6d162fa (diff)
downloadpoky-983bd9a77e4afdb2890245653f39d6c6d093a655.tar.gz
qemu: Add some checks before enabling KVM
Check the missing modules and permission with informative output. [BUGID #599] got fixed. Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
-rwxr-xr-xscripts/poky-qemu25
1 files changed, 22 insertions, 3 deletions
diff --git a/scripts/poky-qemu b/scripts/poky-qemu
index 313248ff49..b19a89ddab 100755
--- a/scripts/poky-qemu
+++ b/scripts/poky-qemu
@@ -29,7 +29,7 @@ usage() {
29 echo " Additional QEMU command-line options can be passed with:" 29 echo " Additional QEMU command-line options can be passed with:"
30 echo " nographic - disables video console" 30 echo " nographic - disables video console"
31 echo " serial - enables a serial console on /dev/ttyS0" 31 echo " serial - enables a serial console on /dev/ttyS0"
32 echo " kvm - enables kvm" 32 echo " kvm - enables KVM when running qemux86/qemux86-64, VT capable CPU required"
33 echo " \"<extra-qemu-options>\" - enables extra qemu options, excluding serial and kvm" 33 echo " \"<extra-qemu-options>\" - enables extra qemu options, excluding serial and kvm"
34 echo "" 34 echo ""
35 echo "Examples:" 35 echo "Examples:"
@@ -171,10 +171,29 @@ while [ $i -le $# ]; do
171 i=$((i + 1)) 171 i=$((i + 1))
172done 172done
173 173
174POKY_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
174# Detect KVM configuration 175# Detect KVM configuration
175if [[ "x$KVM_ENABLED" == "xyes" && ! -z "$KVM_CAPABLE" ]]; then 176if [[ "x$KVM_ENABLED" == "xyes" ]]; then
176 if [[ "x$MACHINE" == "xqemux86" || "x$MACHINE" == "xqemux86-64" ]]; then 177 if [[ -z "$KVM_CAPABLE" ]]; then
178 echo "You are tring to enable KVM on cpu without VT support. Remove kvm from the command-line, or refer";
179 echo "$POKY_KVM_WIKI";
180 exit 1;
181 fi
182 if [[ "x$MACHINE" != "xqemux86" && "x$MACHINE" != "xqemux86-64" ]]; then
183 echo "KVM only support x86 & x86-64. Remove kvm from the command-line";
184 exit 1;
185 fi
186 if [ ! -e /dev/kvm ]; then
187 echo "Missing KVM device. Have you inserted kvm modules? Pls. refer";
188 echo "$POKY_KVM_WIKI";
189 exit 1;
190 fi
191 if 9<>/dev/kvm ; then
177 SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm" 192 SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm"
193 else
194 echo "You have no rights on /dev/kvm. Pls. change the owndership as described at";
195 echo "$POKY_KVM_WIKI";
196 exit 1;
178 fi 197 fi
179fi 198fi
180 199