diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2015-10-22 10:18:39 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-27 07:24:28 +0000 |
commit | 9846275484fa937ce6dd59a6cdb627c098b0d756 (patch) | |
tree | 729f34f0439943bbf1f8bb094a85f8a2e3f46498 /scripts | |
parent | 304c95696e407c7171fab7eb4220336f9e17f9cf (diff) | |
download | poky-9846275484fa937ce6dd59a6cdb627c098b0d756.tar.gz |
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]
(From OE-Core rev: 0611321c9d6663493b37c33dea51e05511db4fbe)
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu-internal | 59 |
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 | |||
120 | KERNEL_NETWORK_CMD="ip=dhcp" | 120 | KERNEL_NETWORK_CMD="ip=dhcp" |
121 | QEMU_TAP_CMD="" | 121 | QEMU_TAP_CMD="" |
122 | QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet" | 122 | QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet" |
123 | if [ "$KVM_ACTIVE" = "yes" ]; then | 123 | QEMU_NETWORK_CMD="" |
124 | QEMU_NETWORK_CMD="" | 124 | DROOT="/dev/vda" |
125 | DROOT="/dev/vda" | 125 | ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw" |
126 | ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw" | ||
127 | else | ||
128 | QEMU_NETWORK_CMD="" | ||
129 | DROOT="/dev/hda" | ||
130 | ROOTFS_OPTIONS="-drive file=$ROOTFS,if=ide,format=raw" | ||
131 | fi | ||
132 | |||
133 | else | 126 | else |
134 | acquire_lock() { | 127 | acquire_lock() { |
135 | lockfile=$1 | 128 | lockfile=$1 |
@@ -266,24 +259,13 @@ else | |||
266 | 259 | ||
267 | KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0" | 260 | KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0" |
268 | QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no" | 261 | QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no" |
269 | if [ "$KVM_ACTIVE" = "yes" ]; then | 262 | if [ "$VHOST_ACTIVE" = "yes" ]; then |
270 | if [ "$VHOST_ACTIVE" = "yes" ]; then | 263 | QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on" |
271 | QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on" | ||
272 | else | ||
273 | QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD" | ||
274 | fi | ||
275 | DROOT="/dev/vda" | ||
276 | ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw" | ||
277 | else | 264 | else |
278 | QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD" | 265 | QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD" |
279 | DROOT="/dev/hda" | ||
280 | ROOTFS_OPTIONS="-drive file=$ROOTFS,if=ide,format=raw" | ||
281 | fi | ||
282 | if [ "$MACHINE" = "qemuarm64" ]; then | ||
283 | QEMU_NETWORK_CMD="-netdev tap,id=net0,ifname=$TAP,script=no,downscript=no -device virtio-net-device,netdev=net0 " | ||
284 | DROOT="/dev/vda" | ||
285 | ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS,if=none,format=raw -device virtio-blk-device,drive=disk0" | ||
286 | fi | 266 | fi |
267 | DROOT="/dev/vda" | ||
268 | ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw" | ||
287 | 269 | ||
288 | KERNCMDLINE="mem=$QEMU_MEMORY" | 270 | KERNCMDLINE="mem=$QEMU_MEMORY" |
289 | QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet" | 271 | QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet" |
@@ -368,16 +350,6 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "qemuarmv6" -o "$MACHINE" = "qemuarm | |||
368 | QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS" | 350 | QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS" |
369 | # QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -force-pointer" | 351 | # QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -force-pointer" |
370 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then | 352 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then |
371 | if [ "$MACHINE" = "qemuarm" ]; then | ||
372 | QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD" | ||
373 | DROOT="/dev/vda" | ||
374 | ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw" | ||
375 | else | ||
376 | QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD" | ||
377 | DROOT="/dev/sda" | ||
378 | ROOTFS_OPTIONS="-drive file=$ROOTFS,format=raw" | ||
379 | fi | ||
380 | |||
381 | KERNCMDLINE="root=$DROOT rw console=ttyAMA0,115200 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY highres=off" | 353 | KERNCMDLINE="root=$DROOT rw console=ttyAMA0,115200 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY highres=off" |
382 | QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS" | 354 | QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS" |
383 | fi | 355 | fi |
@@ -401,6 +373,10 @@ fi | |||
401 | if [ "$MACHINE" = "qemuarm64" ]; then | 373 | if [ "$MACHINE" = "qemuarm64" ]; then |
402 | QEMU=qemu-system-aarch64 | 374 | QEMU=qemu-system-aarch64 |
403 | 375 | ||
376 | QEMU_NETWORK_CMD="-netdev tap,id=net0,ifname=$TAP,script=no,downscript=no -device virtio-net-device,netdev=net0 " | ||
377 | DROOT="/dev/vda" | ||
378 | ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS,if=none,format=raw -device virtio-blk-device,drive=disk0" | ||
379 | |||
404 | export QEMU_AUDIO_DRV="none" | 380 | export QEMU_AUDIO_DRV="none" |
405 | if [ "x$SERIALSTDIO" = "x" ] ; then | 381 | if [ "x$SERIALSTDIO" = "x" ] ; then |
406 | QEMU_UI_OPTIONS="-nographic" | 382 | QEMU_UI_OPTIONS="-nographic" |
@@ -408,7 +384,7 @@ if [ "$MACHINE" = "qemuarm64" ]; then | |||
408 | QEMU_UI_OPTIONS="" | 384 | QEMU_UI_OPTIONS="" |
409 | fi | 385 | fi |
410 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then | 386 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then |
411 | KERNCMDLINE="root=/dev/vda rw console=ttyAMA0,38400 mem=$QEMU_MEMORY highres=off $KERNEL_NETWORK_CMD" | 387 | KERNCMDLINE="root=$DROOT rw console=ttyAMA0,38400 mem=$QEMU_MEMORY highres=off $KERNEL_NETWORK_CMD" |
412 | # qemu-system-aarch64 only support '-machine virt -cpu cortex-a57' for now | 388 | # qemu-system-aarch64 only support '-machine virt -cpu cortex-a57' for now |
413 | QEMUOPTIONS="$QEMU_NETWORK_CMD -machine virt -cpu cortex-a57 $ROOTFS_OPTIONS $QEMU_UI_OPTIONS" | 389 | QEMUOPTIONS="$QEMU_NETWORK_CMD -machine virt -cpu cortex-a57 $ROOTFS_OPTIONS $QEMU_UI_OPTIONS" |
414 | fi | 390 | fi |
@@ -423,7 +399,6 @@ if [ "$MACHINE" = "qemuarm64" ]; then | |||
423 | fi | 399 | fi |
424 | fi | 400 | fi |
425 | 401 | ||
426 | |||
427 | if [ "$MACHINE" = "qemux86" ]; then | 402 | if [ "$MACHINE" = "qemux86" ]; then |
428 | QEMU=qemu-system-i386 | 403 | QEMU=qemu-system-i386 |
429 | if [ "$KVM_ACTIVE" = "yes" ]; then | 404 | if [ "$KVM_ACTIVE" = "yes" ]; then |
@@ -522,8 +497,8 @@ if [ "$MACHINE" = "qemumips" -o "$MACHINE" = "qemumipsel" -o "$MACHINE" = "qemum | |||
522 | QEMU_UI_OPTIONS="-vga cirrus $QEMU_UI_OPTIONS" | 497 | QEMU_UI_OPTIONS="-vga cirrus $QEMU_UI_OPTIONS" |
523 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then | 498 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then |
524 | #KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" | 499 | #KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" |
525 | KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" | 500 | KERNCMDLINE="root=$DROOT rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" |
526 | QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS" | 501 | QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS" |
527 | fi | 502 | fi |
528 | if [ "$FSTYPE" = "nfs" ]; then | 503 | if [ "$FSTYPE" = "nfs" ]; then |
529 | if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then | 504 | if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then |
@@ -547,8 +522,8 @@ if [ "$MACHINE" = "qemuppc" ]; then | |||
547 | QEMU_NETWORK_CMD="-net nic,model=pcnet $QEMU_TAP_CMD" | 522 | QEMU_NETWORK_CMD="-net nic,model=pcnet $QEMU_TAP_CMD" |
548 | fi | 523 | fi |
549 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then | 524 | if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then |
550 | KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" | 525 | KERNCMDLINE="root=$DROOT rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" |
551 | QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS" | 526 | QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS" |
552 | fi | 527 | fi |
553 | if [ "$FSTYPE" = "nfs" ]; then | 528 | if [ "$FSTYPE" = "nfs" ]; then |
554 | if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then | 529 | if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then |