} >>"$FULL"
}
-# /dev/sd... device node assigned to the scsi_debug kernel module.
-scsi_debug_dev_path() {
- local bd="" d
-
- for d in /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*/block/*; do
- [ -e "$d" ] || continue
- bd=${d/*\//}
- done
- [ -n "$bd" ] || return 1
- echo "/dev/$bd"
-}
-
# Look up the block device below the filesystem for directory $1.
block_dev_of_dir() {
df "$1" | {
# Copyright (c) 2018 Western Digital Corporation or its affiliates
. common/rc
+. common/scsi_debug
. common/multipath-over-rdma
vdev_path=(/dev/nullb0 /dev/nullb1 scsi_debug_dev_path_will_be_set_later)
start_srpt() {
local bd i
- modprobe scsi_debug delay=0 dif=3 dix=1 dev_size_mb=$((ramdisk_size>>20))
- for ((i=0;i<10;i++)); do
- bd=$(scsi_debug_dev_path) && break
- sleep .1
- done
- if [ -z "$bd" ]; then
- echo "scsi_debug device instance not found"
- return 1
- fi
- vdev_path[2]=$bd
+ _init_scsi_debug delay=0 dev_size_mb=$((ramdisk_size>>20)) dif=3 dix=1\
+ || return $?
+ vdev_path[2]=/dev/${SCSI_DEBUG_DEVICES[0]}
modprobe ib_uverbs
modprobe ib_umad
modprobe rdma_cm
# Unload the SRP target driver.
stop_srpt() {
stop_lio_srpt || return $?
- unload_module scsi_debug
+ _exit_scsi_debug
}
start_target() {