Commit 252d418c authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Daniel Verkamp
Browse files

setup.sh: do not use lsblk -o SUBSYSTEMS



It's apparently unavailable on some systems.
We used it to grep all Virtio-PCI block devices
before matching them against our desired PCI bdf
in get_virtio_names_from_bdf(). If we were unbinding
a Virtio-PCI device and lsblk failed, the script
assumed there were no block devices and hence no
active mountpoints for that Virtio device. The initial
grep is not necessary and, since it's causing us
troubles, is now being removed.

Change-Id: I5a621391dc4772b2bd67eaa832e318d9a0d25948
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/401780


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 6140f2d1
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -131,14 +131,12 @@ function get_nvme_name_from_bdf {
}

function get_virtio_names_from_bdf {
	set +e
	virtio_ctrlrs=`lsblk --nodeps --output "NAME,SUBSYSTEMS" | grep virtio | awk '{print $1}'`
	set -e
	blk_devs=`lsblk --nodeps --output NAME`
	virtio_names=''

	for ctrlr in $virtio_ctrlrs; do
		if readlink "/sys/block/$ctrlr" | grep -q "$1"; then
			virtio_names="$virtio_names $ctrlr"
	for dev in $blk_devs; do
		if readlink "/sys/block/$dev" | grep -q "$1"; then
			virtio_names="$virtio_names $dev"
		fi
	done