guests: sshable: fix breaking out from wait loop

This commit is contained in:
Yousong Zhou
2021-05-10 17:07:51 +08:00
parent f6271885c1
commit 59f99c653a
+2 -1
View File
@@ -213,10 +213,11 @@ func (guest *SGuest) sshableTryEach(
tmo := time.NewTimer(13 * time.Second)
tick := time.NewTicker(3 * time.Second)
out:
for {
select {
case <-tmo.C:
break
break out
case <-tick.C:
if ok := guest.sshableTryForward(ctx, tryData, &fwd); ok {
return nil