diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-03-30 15:21:19 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-03-30 15:21:19 -0500 |
commit | b4a027550acf2c1051c34f997b8e7e845017af4b (patch) | |
tree | 9e38d3c17b42cb1e6765620a87e908973a93c821 /yocto-poky/scripts/runqemu | |
parent | 2fe86d90044af218ced8f42fdded6b136f1046d2 (diff) | |
parent | f1e5d6968976c2341c6d554bfcc8895f1b33c26b (diff) | |
download | talos-openbmc-b4a027550acf2c1051c34f997b8e7e845017af4b.tar.gz talos-openbmc-b4a027550acf2c1051c34f997b8e7e845017af4b.zip |
Merge commit 'f1e5d6968976c2341c6d554bfcc8895f1b33c26b' from yocto-2.0.1
Diffstat (limited to 'yocto-poky/scripts/runqemu')
-rwxr-xr-x | yocto-poky/scripts/runqemu | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/yocto-poky/scripts/runqemu b/yocto-poky/scripts/runqemu index 23cf5be16..e01d276f7 100755 --- a/yocto-poky/scripts/runqemu +++ b/yocto-poky/scripts/runqemu @@ -33,6 +33,7 @@ usage() { echo " nographic - disables video console" echo " serial - enables a serial console on /dev/ttyS0" echo " kvm - enables KVM when running qemux86/qemux86-64 (VT-capable CPU required)" + echo " kvm-vhost - enables KVM with vhost support when running qemux86/qemux86-64 (VT-capable CPU required)" echo " publicvnc - enable a VNC server open to all hosts" echo " qemuparams=\"xyz\" - specify custom parameters to QEMU" echo " bootparams=\"xyz\" - specify custom kernel parameters during boot" @@ -71,6 +72,8 @@ SERIALSTDIO="" TCPSERIAL_PORTNUM="" KVM_ENABLED="no" KVM_ACTIVE="no" +VHOST_ENABLED="no" +VHOST_ACTIVE="no" # Determine whether the file is a kernel or QEMU image, and set the # appropriate variables @@ -111,7 +114,7 @@ while true; do case "$arg" in "qemux86" | "qemux86-64" | "qemuarm" | "qemuarm64" | "qemumips" | "qemumipsel" | \ "qemumips64" | "qemush4" | "qemuppc" | "qemumicroblaze" | "qemuzynq") - [ -z "$MACHINE" ] && MACHINE=$arg || \ + [ -z "$MACHINE" -o "$MACHINE" = "$arg" ] && MACHINE=$arg || \ error "conflicting MACHINE types [$MACHINE] and [$arg]" ;; "ext2" | "ext3" | "ext4" | "jffs2" | "nfs" | "btrfs" | "hddimg" | "hdddirect" ) @@ -170,6 +173,11 @@ while true; do KVM_ENABLED="yes" KVM_CAPABLE=`grep -q 'vmx\|svm' /proc/cpuinfo && echo 1` ;; + "kvm-vhost") + KVM_ENABLED="yes" + KVM_CAPABLE=`grep -q 'vmx\|svm' /proc/cpuinfo && echo 1` + VHOST_ENABLED="yes" + ;; "slirp") SLIRP_ENABLED="yes" ;; @@ -270,12 +278,6 @@ if [ "x$KVM_ENABLED" = "xyes" ]; then echo "$YOCTO_KVM_WIKI"; exit 1; fi - if [ ! -e /dev/vhost-net ]; then - echo "Missing virtio net device. Have you inserted vhost-net module?" - echo "For further help see:" - echo "$YOCTO_PARAVIRT_KVM_WIKI"; - exit 1; - fi if [ -w /dev/kvm -a -r /dev/kvm ]; then SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm" KVM_ACTIVE="yes" @@ -285,13 +287,22 @@ if [ "x$KVM_ENABLED" = "xyes" ]; then echo "$YOCTO_KVM_WIKI"; exit 1; fi - if [ ! -w /dev/vhost-net -o ! -r /dev/vhost-net ]; then - if [ "$SLIRP_ENABLED" != "yes" ] ; then + if [ "x$VHOST_ENABLED" = "xyes" ]; then + if [ ! -e /dev/vhost-net ]; then + echo "Missing virtio net device. Have you inserted vhost-net module?" + echo "For further help see:" + echo "$YOCTO_PARAVIRT_KVM_WIKI"; + exit 1; + fi + + if [ -w /dev/vhost-net -a -r /dev/vhost-net ]; then + VHOST_ACTIVE="yes" + else echo "You have no rights on /dev/vhost-net." echo "Please change the ownership of this file as described at:" - echo "$YOCTO_PARAVIRT_KVM_WIKI"; + echo "$YOCTO_KVM_WIKI"; exit 1; - fi + fi fi fi |