diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2017-04-13 22:32:51 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-28 11:26:06 +0100 |
commit | 5cbf102662dde6f706a19fa133cfd1e7475eb8c1 (patch) | |
tree | 9fbd3d116017067692177d1cfcc9838d9170a83f /scripts | |
parent | b85e41eeef3fddc2c15439cf78b8cc8542b5bc22 (diff) | |
download | openembedded-core-5cbf102662dde6f706a19fa133cfd1e7475eb8c1.tar.gz openembedded-core-5cbf102662dde6f706a19fa133cfd1e7475eb8c1.tar.bz2 openembedded-core-5cbf102662dde6f706a19fa133cfd1e7475eb8c1.zip |
runqemu: support virtio drive type
Setting QB_DRIVE_TYPE=/dev/vd selects virtio without triggering any
warnings. Previously, that was only possible by setting an unknown
value and relying on the fallback to virtio, which caused some
warnings to be printed.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 605bcf25d6..f0ddeea1bf 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -992,12 +992,15 @@ class BaseConfig(object): logger.info('Using ide drive') vm_drive = "%s,format=%s" % (self.rootfs, rootfs_format) else: - logger.warn("Unknown QB_DRIVE_TYPE: %s" % drive_type) - - if not vm_drive: - logger.warn("Failed to figure out drive type, consider define or fix QB_DRIVE_TYPE") - logger.warn('Trying to use virtio block drive') - vm_drive = '-drive if=virtio,file=%s,format=%s' % (self.rootfs, rootfs_format) + # virtio might have been selected explicitly (just use it), or + # is used as fallback (then warn about that). + if not drive_type.startswith("/dev/vd"): + logger.warn("Unknown QB_DRIVE_TYPE: %s" % drive_type) + logger.warn("Failed to figure out drive type, consider define or fix QB_DRIVE_TYPE") + logger.warn('Trying to use virtio block drive') + vm_drive = '-drive if=virtio,file=%s,format=%s' % (self.rootfs, rootfs_format) + + # All branches above set vm_drive. self.rootfs_options = '%s -no-reboot' % vm_drive self.kernel_cmdline = 'root=%s rw highres=off' % (self.get('QB_KERNEL_ROOT')) |