vhost: fix vm_wait_for_boot arg check.

This was changed recently to enable a shell coding style checker, but $*
does not represent the number of arguments supplied to the function,
rather it is an alternative version of $@ that stores all arguments in a
single string. So we should be checking against an empty string and not
0.

By checking against 0, every time we passed 0 into vm_wait_for_boot, we
tried booting every vm in that directory. This causes errors on nightly
tests and intermittent failures during per-patch testing.

Change-Id: I1850ea73ea59fdc244de1a91e4c6de1b4505e518
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470087
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Seth Howell 2019-10-01 12:40:07 -07:00 committed by Ben Walker
parent 338fcaac4e
commit eda1ec6932

View File

@ -899,7 +899,7 @@ function vm_wait_for_boot()
notice "Waiting for VMs to boot" notice "Waiting for VMs to boot"
shift shift
if [[ "$*" == 0 ]]; then if [[ "$*" == "" ]]; then
local vms_to_check="$VM_DIR/[0-9]*" local vms_to_check="$VM_DIR/[0-9]*"
else else
local vms_to_check="" local vms_to_check=""