From e834297b39d415a9df3d5e56a7587e84b49e8d6c Mon Sep 17 00:00:00 2001 From: Anders F Björklund Date: Fri, 21 Jan 2022 08:10:13 +0100 Subject: Restore machine start logic that was hanging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After refactoring Stop(), mounting volumes was hanging in Start(). Restore the conditional, and add error reporting from isListening. [NO NEW TESTS NEEDED] Signed-off-by: Anders F Björklund --- pkg/machine/qemu/machine.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/machine/qemu') diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go index e1870f1ac..eb7b35ece 100644 --- a/pkg/machine/qemu/machine.go +++ b/pkg/machine/qemu/machine.go @@ -390,12 +390,14 @@ func (v *MachineVM) Start(name string, _ machine.StartOptions) error { if err != nil { return err } - for running || !v.isListening() { + listening := v.isListening() + for !running || !listening { time.Sleep(100 * time.Millisecond) running, err = v.isRunning() if err != nil { return err } + listening = v.isListening() } } for _, mount := range v.Mounts { -- cgit v1.2.3-54-g00ecf