Skip to content

Commit 6371ec1

Browse files
committed
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 <[email protected]>
1 parent 4204718 commit 6371ec1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/runqemu

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,9 @@ class BaseConfig(object):
11871187
elif drive_type.startswith("/dev/hd"):
11881188
logger.info('Using ide drive')
11891189
vm_drive = "-drive file=%s,format=%s" % (self.rootfs, rootfs_format)
1190+
elif drive_type.startswith("/dev/vdb"):
1191+
logger.info('Using block virtio drive');
1192+
vm_drive = '-drive id=disk0,file=%s,if=none,format=%s -device virtio-blk-device,drive=disk0' % (self.rootfs, rootfs_format)
11901193
else:
11911194
# virtio might have been selected explicitly (just use it), or
11921195
# is used as fallback (then warn about that).

0 commit comments

Comments
 (0)