1
0

Stop waiting for ssh if qemu is dead

This commit is contained in:
dump_stack() 2023-05-10 12:30:01 +00:00
parent 31370b7bad
commit d5ea97c532
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

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
}