-case $TARGET_ARCH in
- i386) QEMU=qemu ; ARGS="" ;;
- 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
+
+# use kvm if available
+has_kvm=$(type -p qemu-kvm)
+if [ -n "$has_kvm" ] ; then
+ QEMU="qemu-kvm" ; ARGS=""
+else
+ case $TARGET_ARCH in
+ i386) QEMU=qemu ; ARGS="" ;;
+ 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
+fi