summaryrefslogtreecommitdiff
path: root/scripts/runqemu-internal
diff options
context:
space:
mode:
authorCristian Iorga <cristian.iorga@intel.com>2012-09-19 10:06:54 +0300
committerSaul Wold <sgw@linux.intel.com>2012-09-20 22:21:14 -0700
commita35d03e2eb905de4eadc9c7df5b50bff1fb7f897 (patch)
treeb6765e6638f0bdb0c592513ff49d94ffc982bdc4 /scripts/runqemu-internal
parent465d7b6e66b5a55706535e194b3e44e11ee542c6 (diff)
downloadopenembedded-core-a35d03e2eb905de4eadc9c7df5b50bff1fb7f897.tar.gz
openembedded-core-a35d03e2eb905de4eadc9c7df5b50bff1fb7f897.tar.bz2
openembedded-core-a35d03e2eb905de4eadc9c7df5b50bff1fb7f897.zip
qemux86: Support for KVM, paravirt and virtio added
KVM, paravirtualization and virtio drivers are now activated in runqemu using the kvm option flag for qemux86. Host CPU features are also exported to guest OS (Yocto Linux). Usage example: runqemu qemux86 core-image-x11 kvm Implements [YOCTO #2550]. Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'scripts/runqemu-internal')
-rwxr-xr-xscripts/runqemu-internal14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index a9b1c44de4..f2c8d8309f 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -221,7 +221,15 @@ n2=$(($n1 + 1))
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"
-QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD"
+if [ "$KVM_ACTIVE" = "yes" ]; then
+ QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on"
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio"
+else
+ QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD"
+ DROOT="/dev/hda"
+ ROOTFS_OPTIONS="-hda $ROOTFS"
+fi
KERNCMDLINE="mem=$QEMU_MEMORY"
QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet"
@@ -321,8 +329,8 @@ if [ "$MACHINE" = "qemux86" ]; then
QEMU=qemu-system-i386
QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -vga vmware"
if [ "$FSTYPE" = "ext2" -o "$FSTYPE" = "ext3" -o "$FSTYPE" = "btrfs" ]; then
- KERNCMDLINE="vga=0 root=/dev/hda rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD"
- QEMUOPTIONS="$QEMU_NETWORK_CMD -hda $ROOTFS $QEMU_UI_OPTIONS"
+ KERNCMDLINE="vga=0 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
fi
if [ "$FSTYPE" = "nfs" ]; then
if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then