mirror of
https://github.com/containers/podman.git
synced 2026-03-17 06:07:46 -04:00
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>