automation-tests/pkg/machine/qemu
Valentin Rothberg 8b7701f522 machine: QEMU: recover from failed start
After a failed start, we can run into (somehow inconsistent) states
where the machine won't start because a previous QEMU process is still
running and the PID file is being used.  Stop didn't resolve the issue
as this state wasn't detected.

Allow to recover from this state by a) detecting it during start and
error out with a more helpful message than the error QEMU would
otherwise spit out, and b) by enabling stop to kill the dangling QEMU
process - even after a failed stop.

With the changes, a recovery may look as follows:
```
_  podman git:(main) _ ./bin/darwin/podman machine start
Starting machine "podman-machine-default"
Error: cannot start VM "podman-machine-default": another instance of "/opt/homebrew/bin/qemu-system-aarch64" is already running with process ID 970: please stop and restart the VM
_  podman git:(main) _ ./bin/darwin/podman machine stop
Machine "podman-machine-default" stopped successfully
_  podman git:(main) _ ./bin/darwin/podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
```

Please note that this change does not prevent us from running into such
inconsistent states but only allows for recovering from them.

[NO NEW TESTS NEEDED] - there is no reliable reproducer.

Fixes: #16054
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-08-02 11:08:26 +02:00
..
claim_darwin.go Replace deprecated ioutil 2022-09-20 15:34:27 -04:00
claim_unsupported.go Fixes isRootfull check using qemu machine on Windows 2022-08-24 18:17:18 +03:00
config.go Merge pull request #19385 from jakecorrenti/breakup-qemu-config-funcs 2023-07-28 08:37:42 +02:00
config_test.go pkg/machine: add missing build tags to tests 2022-07-04 18:09:30 +02:00
machine.go machine: QEMU: recover from failed start 2023-08-02 11:08:26 +02:00
machine_test.go refactor(machine): remove hard code 2023-06-21 18:49:12 +08:00
machine_unix.go Support for Windows paths in the source position of the volume mounts 2023-01-30 23:33:33 +02:00
machine_unsupported.go bump golangci-lint to v1.49.0 2022-10-17 09:19:41 +02:00
machine_windows.go Support for Windows paths in the source position of the volume mounts 2023-01-30 23:33:33 +02:00
options_darwin.go Fix #11418 - Default TMPDIR to /tmp on OS X 2021-09-04 08:40:57 +02:00
options_darwin_amd64.go Fix warning of unsupported feature on MacOS 2021-09-06 09:55:24 -07:00
options_darwin_arm64.go Revert "Resolve symlink path for qemu directory if possible" 2023-04-24 10:06:43 -06:00
options_freebsd.go pkg: Build pkg/machine on FreeBSD 2022-08-13 07:53:34 +01:00
options_freebsd_amd64.go pkg: Build pkg/machine on FreeBSD 2022-08-13 07:53:34 +01:00
options_freebsd_arm64.go pkg/machine: Make this build on FreeBSD/arm64 2022-10-31 15:13:49 +00:00
options_linux.go bump go module to version 4 2022-01-18 12:47:07 +01:00
options_linux_amd64.go Add machine support for more Linux distros 2021-03-28 13:35:56 +02:00
options_linux_arm64.go Add machine support for qemu-system-aarch64 2021-03-29 21:53:48 +02:00
options_windows.go Improved Windows compatibility for machine command 2022-08-29 16:53:42 +03:00
options_windows_amd64.go Updated options for QEMU on Windows hosts 2023-01-09 23:58:47 +02:00
options_windows_arm64.go Updated options for QEMU on Windows hosts 2023-01-09 23:58:47 +02:00