Skip to content

Commit

Permalink
runqemu: add virtio block device
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
muvarov committed Nov 22, 2019
1 parent 4204718 commit 1d2058f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/runqemu
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 1d2058f

Please sign in to comment.