Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Unified Diff: lib/cros_vm_lib.sh

Issue 6413019: Robustify starting of ssh connection to vm updater. (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bin/cros_run_vm_update ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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}"
« no previous file with comments | « bin/cros_run_vm_update ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698