diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-08-23 18:28:43 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-08-23 18:32:15 -0400 |
commit | fd0303f6780b619b6fed8391760a228bfcfb5bde (patch) | |
tree | 1ac28cac922ae3666621b980741ea81f4d795b8d | |
parent | 0c415915cf69f4d7e45c0a05bd8a8c4648f7f85c (diff) |
Bring back partial support for virtio-blk
virtio-scsi is, unfortunately, buggy: this patch brings back partial
support for virtio-blk (we don't yet handle sda vs. vda naming)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | lib/libktest.sh | 12 | ||||
-rw-r--r-- | tests/kconfig.sh | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/libktest.sh b/lib/libktest.sh index 186f96c..fce85bb 100644 --- a/lib/libktest.sh +++ b/lib/libktest.sh @@ -324,7 +324,6 @@ start_vm() -gdb "unix:$ktest_out/vm/gdb,server,nowait" \ -device virtio-rng-pci \ -virtfs local,path=/,mount_tag=host,security_model=none \ - -device $ktest_storage_bus,id=hba \ ) if [[ -f $ktest_kernel_binary/initramfs ]]; then @@ -362,6 +361,14 @@ start_vm() exit 1 esac + case $ktest_storage_bus in + virtio-blk) + ;; + *) + qemu_cmd+=(-device $ktest_storage_bus,id=hba) + ;; + esac + local disknr=0 qemu_disk() @@ -371,6 +378,9 @@ start_vm() ahci|piix4-ide) qemu_cmd+=(-device ide-hd,bus=hba.$disknr,drive=disk$disknr) ;; + virtio-blk) + qemu_cmd+=(-device virtio-blk-device,drive=disk$disknr,bootindex=$disknr) + ;; *) qemu_cmd+=(-device scsi-hd,bus=hba.0,drive=disk$disknr) ;; diff --git a/tests/kconfig.sh b/tests/kconfig.sh index 873c415..420fc3b 100644 --- a/tests/kconfig.sh +++ b/tests/kconfig.sh @@ -129,6 +129,9 @@ case $ktest_storage_bus in virtio-scsi-pci) require-kernel-config SCSI_VIRTIO ;; + virtio-blk) + require-kernel-config VIRTIO_BLK + ;; ahci) require-kernel-config ATA require-kernel-config SATA_AHCI |