summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-10-22 10:18:39 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-24 12:19:43 +0100
commit0611321c9d6663493b37c33dea51e05511db4fbe (patch)
tree05d7c420bef43f0efc45db89be00f5026d70e385
parent16dad3a6ccba01639b3a711426599af49c30a088 (diff)
downloadopenembedded-core-contrib-0611321c9d6663493b37c33dea51e05511db4fbe.tar.gz
openembedded-core-contrib-0611321c9d6663493b37c33dea51e05511db4fbe.tar.bz2
openembedded-core-contrib-0611321c9d6663493b37c33dea51e05511db4fbe.zip
runqemu-internal: Enable support for use virtio devices.
Enable virtio usage for default in runqemu also get rid of duplicate configuration from now all qemu machines uses virtio. [YOCTO #8427] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rwxr-xr-xscripts/runqemu-internal59
1 files changed, 17 insertions, 42 deletions
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 38ea965bdf..3b0e54c86e 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -120,16 +120,9 @@ if [ "$SLIRP_ENABLED" = "yes" ]; then
KERNEL_NETWORK_CMD="ip=dhcp"
QEMU_TAP_CMD=""
QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet"
- if [ "$KVM_ACTIVE" = "yes" ]; then
- QEMU_NETWORK_CMD=""
- DROOT="/dev/vda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
- else
- QEMU_NETWORK_CMD=""
- DROOT="/dev/hda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=ide,format=raw"
- fi
-
+ QEMU_NETWORK_CMD=""
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
else
acquire_lock() {
lockfile=$1
@@ -266,24 +259,13 @@ else
KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0"
QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no"
- if [ "$KVM_ACTIVE" = "yes" ]; then
- if [ "$VHOST_ACTIVE" = "yes" ]; then
- QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on"
- else
- QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD"
- fi
- DROOT="/dev/vda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
+ if [ "$VHOST_ACTIVE" = "yes" ]; then
+ QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on"
else
- QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD"
- DROOT="/dev/hda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=ide,format=raw"
- fi
- if [ "$MACHINE" = "qemuarm64" ]; then
- QEMU_NETWORK_CMD="-netdev tap,id=net0,ifname=$TAP,script=no,downscript=no -device virtio-net-device,netdev=net0 "
- DROOT="/dev/vda"
- ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS,if=none,format=raw -device virtio-blk-device,drive=disk0"
+ QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD"
fi
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
KERNCMDLINE="mem=$QEMU_MEMORY"
QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet"
@@ -368,16 +350,6 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "qemuarmv6" -o "$MACHINE" = "qemuarm
QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
# QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -force-pointer"
if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
- if [ "$MACHINE" = "qemuarm" ]; then
- QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD"
- DROOT="/dev/vda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
- else
- QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD"
- DROOT="/dev/sda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,format=raw"
- fi
-
KERNCMDLINE="root=$DROOT rw console=ttyAMA0,115200 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY highres=off"
QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
fi
@@ -401,6 +373,10 @@ fi
if [ "$MACHINE" = "qemuarm64" ]; then
QEMU=qemu-system-aarch64
+ QEMU_NETWORK_CMD="-netdev tap,id=net0,ifname=$TAP,script=no,downscript=no -device virtio-net-device,netdev=net0 "
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS,if=none,format=raw -device virtio-blk-device,drive=disk0"
+
export QEMU_AUDIO_DRV="none"
if [ "x$SERIALSTDIO" = "x" ] ; then
QEMU_UI_OPTIONS="-nographic"
@@ -408,7 +384,7 @@ if [ "$MACHINE" = "qemuarm64" ]; then
QEMU_UI_OPTIONS=""
fi
if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
- KERNCMDLINE="root=/dev/vda rw console=ttyAMA0,38400 mem=$QEMU_MEMORY highres=off $KERNEL_NETWORK_CMD"
+ KERNCMDLINE="root=$DROOT rw console=ttyAMA0,38400 mem=$QEMU_MEMORY highres=off $KERNEL_NETWORK_CMD"
# qemu-system-aarch64 only support '-machine virt -cpu cortex-a57' for now
QEMUOPTIONS="$QEMU_NETWORK_CMD -machine virt -cpu cortex-a57 $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
fi
@@ -423,7 +399,6 @@ if [ "$MACHINE" = "qemuarm64" ]; then
fi
fi
-
if [ "$MACHINE" = "qemux86" ]; then
QEMU=qemu-system-i386
if [ "$KVM_ACTIVE" = "yes" ]; then
@@ -522,8 +497,8 @@ if [ "$MACHINE" = "qemumips" -o "$MACHINE" = "qemumipsel" -o "$MACHINE" = "qemum
QEMU_UI_OPTIONS="-vga cirrus $QEMU_UI_OPTIONS"
if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
#KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
- KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
- QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS"
+ KERNCMDLINE="root=$DROOT rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
fi
if [ "$FSTYPE" = "nfs" ]; then
if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
@@ -547,8 +522,8 @@ if [ "$MACHINE" = "qemuppc" ]; then
QEMU_NETWORK_CMD="-net nic,model=pcnet $QEMU_TAP_CMD"
fi
if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
- KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
- QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS"
+ KERNCMDLINE="root=$DROOT rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
fi
if [ "$FSTYPE" = "nfs" ]; then
if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then