diff options
| author | Zhai Edwin <edwin.zhai@intel.com> | 2010-12-02 15:11:53 +0800 |
|---|---|---|
| committer | Saul Wold <sgw@linux.intel.com> | 2010-12-09 08:18:18 -0800 |
| commit | a1175b89066dbea7ab6783ac68e9b2ce98b326b0 (patch) | |
| tree | d0fdd9e46a87c3c0c8e179ece0959e52d364a36b | |
| parent | 3d08b9f2c65835822b1c0ed30e3170f02f877ce3 (diff) | |
| download | poky-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>
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 2 | ||||
| -rwxr-xr-x | scripts/poky-qemu | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 12ce82fe8e..33c2c7149a 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -3,7 +3,7 @@ HOMEPAGE = "http://qemu.org" | |||
| 3 | LICENSE = "GPLv2 & LGPLv2.1" | 3 | LICENSE = "GPLv2 & LGPLv2.1" |
| 4 | DEPENDS = "zlib" | 4 | DEPENDS = "zlib" |
| 5 | 5 | ||
| 6 | EXTRA_OECONF = "--target-list=arm-linux-user,arm-softmmu,i386-linux-user,i386-softmmu,x86_64-linux-user,x86_64-softmmu,mips-linux-user,mips-softmmu,ppc-linux-user,ppc-softmmu,mipsel-linux-user --disable-werror --disable-vnc-tls" | 6 | EXTRA_OECONF = "--target-list=arm-linux-user,arm-softmmu,i386-linux-user,i386-softmmu,x86_64-linux-user,x86_64-softmmu,mips-linux-user,mips-softmmu,ppc-linux-user,ppc-softmmu,mipsel-linux-user --disable-werror --disable-vnc-tls --enable-kvm" |
| 7 | #EXTRA_OECONF += "--disable-sdl" | 7 | #EXTRA_OECONF += "--disable-sdl" |
| 8 | 8 | ||
| 9 | inherit autotools | 9 | inherit autotools |
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() { | |||
| 84 | 84 | ||
| 85 | # Parse command line args without requiring specific ordering. It's a | 85 | # Parse command line args without requiring specific ordering. It's a |
| 86 | # bit more complex, but offers a great user experience. | 86 | # bit more complex, but offers a great user experience. |
| 87 | KVM_ENABLED="no" | ||
| 87 | i=1 | 88 | i=1 |
| 88 | while [ $i -le $# ]; do | 89 | while [ $i -le $# ]; do |
| 89 | arg=${!i} | 90 | arg=${!i} |
| @@ -124,6 +125,10 @@ while [ $i -le $# ]; do | |||
| 124 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio" | 125 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio" |
| 125 | SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0" | 126 | SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0" |
| 126 | ;; | 127 | ;; |
| 128 | "kvm") | ||
| 129 | KVM_ENABLED="yes" | ||
| 130 | KVM_CAPABLE=`grep 'vmx\|smx' /proc/cpuinfo` | ||
| 131 | ;; | ||
| 127 | *) | 132 | *) |
| 128 | # A directory name is an nfs rootfs | 133 | # A directory name is an nfs rootfs |
| 129 | if [ -d "$arg" ]; then | 134 | if [ -d "$arg" ]; then |
| @@ -152,6 +157,13 @@ while [ $i -le $# ]; do | |||
| 152 | i=$((i + 1)) | 157 | i=$((i + 1)) |
| 153 | done | 158 | done |
| 154 | 159 | ||
| 160 | # Detect KVM configuration | ||
| 161 | if [[ "x$KVM_ENABLED" == "xyes" && ! -z "$KVM_CAPABLE" ]]; then | ||
| 162 | if [[ "x$MACHINE" == "xqemux86" || "x$MACHINE" == "xqemux86-64" ]]; then | ||
| 163 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm" | ||
| 164 | fi | ||
| 165 | fi | ||
| 166 | |||
| 155 | # Report errors for missing combinations of options | 167 | # Report errors for missing combinations of options |
| 156 | if [[ -z "$MACHINE" && -z "$KERNEL" ]]; then | 168 | if [[ -z "$MACHINE" && -z "$KERNEL" ]]; then |
| 157 | echo "Error: you must specify at least a MACHINE or KERNEL argument" | 169 | echo "Error: you must specify at least a MACHINE or KERNEL argument" |
