summaryrefslogtreecommitdiff
path: root/pkg/machine/qemu/machine.go
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-30 17:58:28 +0000
committerGitHub <noreply@github.com>2022-06-30 17:58:28 +0000
commit01beba3667851c1dd68d3df1e0aa6bc8cb1ec0eb (patch)
tree23cf8c7ae65ff511c1f432d1c43c734a33c48e88 /pkg/machine/qemu/machine.go
parent5a222a8e601b2ef413c39edf5d49d2f140d7a72b (diff)
parent99f68898c0f1c4564cebd6a3ee18418c74684403 (diff)
downloadpodman-01beba3667851c1dd68d3df1e0aa6bc8cb1ec0eb.tar.gz
podman-01beba3667851c1dd68d3df1e0aa6bc8cb1ec0eb.tar.bz2
podman-01beba3667851c1dd68d3df1e0aa6bc8cb1ec0eb.zip
Merge pull request #14704 from baude/machinestopped
reveal machine error, ignore false state
Diffstat (limited to 'pkg/machine/qemu/machine.go')
-rw-r--r--pkg/machine/qemu/machine.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index 48ffb03a4..2fe0230cf 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -963,7 +963,12 @@ func (v *MachineVM) State(bypass bool) (machine.Status, error) {
}
monitor, err := qmp.NewSocketMonitor(v.QMPMonitor.Network, v.QMPMonitor.Address.GetPath(), v.QMPMonitor.Timeout)
if err != nil {
- // FIXME: this error should probably be returned
+ // If an improper cleanup was done and the socketmonitor was not deleted,
+ // it can appear as though the machine state is not stopped. Check for ECONNREFUSED
+ // almost assures us that the vm is stopped.
+ if errors.Is(err, syscall.ECONNREFUSED) {
+ return machine.Stopped, nil
+ }
return "", err
}
if err := monitor.Connect(); err != nil {