[PATCH 3/5] blktests: add dynamic device selection based on storage type

Daniel Gomez <[email protected]> Fri, 26 Sep 2025 15:18:11 +0200
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

The SCSI storage support patch (commit 6e9c9df0e) was incomplete - it added
SCSI device generation in libvirt templates but failed to add the
corresponding test device mapping for blktests.

This caused blktests to use the hardcoded default "/dev/nvme2n1" even when
using SCSI storage, leading to test failures when the expected NVMe device
doesn't exist on SCSI-configured systems.

Add dynamic device selection for blktests similar to other workflows,
supporting NVMe, virtio, IDE, and SCSI storage types.

Fixes: 6e9c9df0e139 ("guestfs: add scsi extra storage option")
Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>
---
 workflows/blktests/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/workflows/blktests/Kconfig b/workflows/blktests/Kconfig
index c5ed2ba1..f9a93161 100644
--- a/workflows/blktests/Kconfig
+++ b/workflows/blktests/Kconfig
@@ -208,6 +208,10 @@ config BLKTESTS_DATA_TARGET
 
 config BLKTESTS_TEST_DEVS
 	string "The devices to use for TEST_DEVS on blktests"
+	default "/dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_kdevops2" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_NVME
+	default "/dev/disk/by-id/virtio-kdevops2" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_VIRTIO
+	default "/dev/disk/by-id/ata-QEMU_HARDDISK_kdevops2" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_IDE
+	default "/dev/sdd" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_SCSI
 	default "/dev/nvme2n1"
 	help
 	  To test with blktests one must set the TEST_DEVS variable, this sets

-- 
2.50.1