From 1d2058f634e375f683ad5b102de5d0f687e96b41 Mon Sep 17 00:00:00 2001 From: Maxim Uvarov Date: Fri, 22 Nov 2019 15:19:00 +0300 Subject: [PATCH] runqemu: add virtio block device Implement new QB_DRIVE_TYPE="/dev/vdb" which fails 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 --- scripts/runqemu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/runqemu b/scripts/runqemu index a05facd0db6e..98d3377b5294 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1187,6 +1187,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).