diff options
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index a9f513c7a9..e6e43f20c8 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -208,6 +208,7 @@ if [ -z "$MACHINE" ]; then | |||
208 | fi | 208 | fi |
209 | 209 | ||
210 | YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu" | 210 | YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu" |
211 | YOCTO_PARAVIRT_KVM_WIKI="https://wiki.yoctoproject.org/wiki/Running_an_x86_Yocto_Linux_image_under_QEMU_KVM" | ||
211 | # Detect KVM configuration | 212 | # Detect KVM configuration |
212 | if [ "x$KVM_ENABLED" = "xyes" ]; then | 213 | if [ "x$KVM_ENABLED" = "xyes" ]; then |
213 | if [ -z "$KVM_CAPABLE" ]; then | 214 | if [ -z "$KVM_CAPABLE" ]; then |
@@ -226,14 +227,27 @@ if [ "x$KVM_ENABLED" = "xyes" ]; then | |||
226 | echo "$YOCTO_KVM_WIKI"; | 227 | echo "$YOCTO_KVM_WIKI"; |
227 | exit 1; | 228 | exit 1; |
228 | fi | 229 | fi |
230 | if [ ! -e /dev/vhost-net ]; then | ||
231 | echo "Missing virtio net device. Have you inserted vhost-net module?" | ||
232 | echo "For further help see" | ||
233 | echo "$YOCTO_PARAVIRT_KVM_WIKI"; | ||
234 | exit 1; | ||
235 | fi | ||
229 | if 9<>/dev/kvm ; then | 236 | if 9<>/dev/kvm ; then |
230 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm" | 237 | SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm -cpu host" |
238 | KVM_ACTIVE="yes" | ||
231 | else | 239 | else |
232 | echo "You have no rights on /dev/kvm." | 240 | echo "You have no rights on /dev/kvm." |
233 | echo "Please change the ownership of this file as described at" | 241 | echo "Please change the ownership of this file as described at" |
234 | echo "$YOCTO_KVM_WIKI"; | 242 | echo "$YOCTO_KVM_WIKI"; |
235 | exit 1; | 243 | exit 1; |
236 | fi | 244 | fi |
245 | if [ ! -w /dev/vhost-net -a -r /dev/vhost-net ]; then | ||
246 | echo "You have no rights on /dev/vhost-net." | ||
247 | echo "Please change the ownership of this file as described at" | ||
248 | echo "$YOCTO_PARAVIRT_KVM_WIKI"; | ||
249 | exit 1; | ||
250 | fi | ||
237 | fi | 251 | fi |
238 | 252 | ||
239 | machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'` | 253 | machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'` |