From 7cd8de9c2bebee2c09a056dbc1d859b916e18e79 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 14 Jul 2022 15:36:47 +0200 Subject: [PATCH] test/vhost: Avoid globbing in the vm_exec() argument Since the command including * was being passed unquoted, the actual pattern was being expanded on the host side. This became problematic when multiple nvme drives were installed inside the host, e.g. the command on the VM side was looking for a specific ctrl which didn't exist there. Fix that by passing the full command as a literal string. Signed-off-by: Michal Berger Change-Id: I3a3d578c735b9a07abb6e0bcefd6db0c343fc27b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13675 Reviewed-by: Jim Harris Reviewed-by: Karol Latecki Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI --- test/vhost/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vhost/common.sh b/test/vhost/common.sh index f2871a639..c989772b8 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -1033,7 +1033,7 @@ function vm_check_blk_location() { } function vm_check_nvme_location() { - SCSI_DISK="$(vm_exec $1 grep -l SPDK /sys/class/nvme/*/model | awk -F/ '{print $5"n1"}')" + SCSI_DISK="$(vm_exec $1 "grep -l SPDK /sys/class/nvme/*/model" | awk -F/ '{print $5"n1"}')" if [[ -z "$SCSI_DISK" ]]; then error "no vfio-user nvme test disk found!" return 1