Skip to content

Commit a361b28

Browse files
committed
ensure mountPoint ends with a single trailing slash when delete vms on it
1 parent ab4557d commit a361b28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/vm/hypervisor/kvm/kvmsmpheartbeat.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ fi
9696
#delete VMs on this mountpoint (best-effort)
9797
deleteVMs() {
9898
local mountPoint=$1
99+
# ensure it ends with a single trailing slash
100+
mountPoint="${mountPoint%/}/"
101+
99102
vmPids=$(ps aux | grep qemu | grep "$mountPoint" | awk '{print $2}' 2> /dev/null)
100103

101104
if [ -z "$vmPids" ]

0 commit comments

Comments
 (0)