Index: lib/cros_vm_lib.sh |
diff --git a/lib/cros_vm_lib.sh b/lib/cros_vm_lib.sh |
index 3a50a627057c5ee758cde10b9c75ce8f4c045314..1246baae39f14ea1bbeb930a509195f68cd26dd0 100644 |
--- a/lib/cros_vm_lib.sh |
+++ b/lib/cros_vm_lib.sh |
@@ -100,10 +100,11 @@ function ssh_ping() { |
# shutting down and restarting kvm. |
function retry_until_ssh() { |
local can_ssh_into=1 |
+ local max_retries=3 |
local retries=0 |
ssh_ping && can_ssh_into=0 |
- while [ ${can_ssh_into} -eq 1 ] && [ ${retries} -lt ${1} ]; do |
+ while [ ${can_ssh_into} -eq 1 ] && [ ${retries} -lt ${max_retries} ]; do |
echo "Failed to connect to virtual machine, retrying ... " >&2 |
stop_kvm || echo "Could not stop kvm. Retrying anyway." >&2 |
start_kvm "${LIVE_VM_IMAGE}" |