summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMaxim Uvarov <maxim.uvarov@linaro.org>2020-01-04 23:08:57 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-06 23:53:55 +0000
commit4d72cd395b2dd40dde1f3809e3ab255938e6a7a1 (patch)
treea6fe96b004f50a1fe6357d522bf47a69c2c702b7 /scripts
parentc308116fb7787794512c3153503ddf9da71803a8 (diff)
downloadopenembedded-core-4d72cd395b2dd40dde1f3809e3ab255938e6a7a1.tar.gz
runqemu: add virtio block device
Implement new QB_DRIVE_TYPE="/dev/vdb" which falls back to virtio block device emulated by qemu. That is needed to support following qemu command line: -drive id=disk0,file=%s,if=none,format=%s \ -device virtio-blk-device,drive=disk0' Real use case is arm64 emulation with qemu with atf+optee+uboot, so that uboot driver sees this disk and able to load from it. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index b6fca041ae..c324982e8a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1196,6 +1196,9 @@ class BaseConfig(object):
elif drive_type.startswith("/dev/hd"):
logger.info('Using ide drive')
vm_drive = "-drive file=%s,format=%s" % (self.rootfs, rootfs_format)
+ elif drive_type.startswith("/dev/vdb"):
+ logger.info('Using block virtio drive');
+ vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0' % (self.rootfs, rootfs_format)
else:
# virtio might have been selected explicitly (just use it), or
# is used as fallback (then warn about that).