]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu: add virtio block device
authorMaxim Uvarov <maxim.uvarov@linaro.org>
Sat, 4 Jan 2020 20:08:57 +0000 (23:08 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 6 Jan 2020 23:53:55 +0000 (23:53 +0000)
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>
scripts/runqemu

index b6fca041aeb165669721086b6088818ea2ecadf4..c324982e8a879aa0ed6712d260b28bd98b5e7a17 100755 (executable)
@@ -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).