From 90998176d9e8cf38453f1d9d420ca5628abbb140 Mon Sep 17 00:00:00 2001 From: Guillaume Rose Date: Fri, 3 Sep 2021 09:06:53 +0200 Subject: machine: always check error of net.Dial, even after last try When net.Dial always fail in the above loop, the code following the loop is executed. This error check prevents this. [NO TESTS NEEDED] Signed-off-by: Guillaume Rose --- pkg/machine/qemu/machine.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/machine') diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go index 38a16c3ef..dc7703724 100644 --- a/pkg/machine/qemu/machine.go +++ b/pkg/machine/qemu/machine.go @@ -278,6 +278,9 @@ func (v *MachineVM) Start(name string, _ machine.StartOptions) error { time.Sleep(wait) wait++ } + if err != nil { + return err + } fd, err := qemuSocketConn.(*net.UnixConn).File() if err != nil { -- cgit v1.2.3-54-g00ecf