[PATCH blktests 2/6] common/scsi_debug: prepare scsi_debug in zoned mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To allow running tests using scsi_debug device with the zoned mode
disabled (current setup) as well as enabled, modify the _init_scsi_debug
helper function. When RUN_FOR_ZONED is set, specify zbc=host-managed
parameter to scsi_debug module so that the scsi_debug devices are
prepared in zoned mode.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
---
 common/scsi_debug | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/common/scsi_debug b/common/scsi_debug
index b48cdc9..95da14e 100644
--- a/common/scsi_debug
+++ b/common/scsi_debug
@@ -9,7 +9,16 @@ _have_scsi_debug() {
 }
 
 _init_scsi_debug() {
-	if ! modprobe -r scsi_debug || ! modprobe scsi_debug "$@"; then
+	local -a args=("$@")
+
+	if (( RUN_FOR_ZONED )); then
+		if ! _have_module_param scsi_debug zbc; then
+			return
+		fi
+		args+=(zbc=host-managed zone_nr_conv=0)
+	fi
+
+	if ! modprobe -r scsi_debug || ! modprobe scsi_debug "${args[@]}"; then
 		return 1
 	fi
 
-- 
2.34.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux