1
0
Fork 0

Stop waiting for ssh if qemu is dead

timestamps
dump_stack() 2023-05-10 12:30:01 +00:00
parent 31370b7bad
commit d5ea97c532
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 5 additions and 0 deletions

View File

@ -342,6 +342,10 @@ func (q System) WaitForSSH(timeout time.Duration) error {
for start := time.Now(); time.Since(start) < timeout; {
time.Sleep(time.Second / 4)
if q.Died || q.KernelPanic {
return errors.New("no ssh (qemu is dead)")
}
client, err := q.ssh("root")
if err != nil {
continue
@ -360,6 +364,7 @@ func (q System) WaitForSSH(timeout time.Duration) error {
}
client.Close()
q.Log.Debug().Msg("ssh is available")
return nil
}