Repository navigation
fix(minimal): stop a wedged VM from the host when min stop --force cannot reach the guest - #2156
Merged
norrietaylor merged 6 commits intoOct 10, 2026
Conversation
cannot reach the guest cmd_stop only stopped the daemon through the in-guest one, so a wedged guest (stuck vsock, OOM) failed the connect or Shutdown RPC and left the VM running, with no recovery short of killing the VMM by hand. minvmd's cmd::stop already had the host-side path; expose it as stop_at(provider_dir) and let the CLI use it: on a VM backend, a connect or Shutdown-RPC failure the daemon cannot be confirmed down from now falls back to stop_at on the resolved provider dir plus wait_for_daemon_stopped, but only with --force, printing one stderr line about the journal replay. Without --force the error keeps failing and names the recovery. The VM-backend gate keys on the provider kind, not the --provider flag alone (NET-081: flagless macOS is minvmd-backed). shutdown_guest_best_effort now resolves the bridge socket from the state dir it is given rather than minvmd's process-global provider dir, which the CLI process never sets and which could otherwise name a sibling VM. Native Linux minimald is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
A VM that went down between the stop probe and the connect is the goal state, not a wedged guest: report it as not running instead of force-stopping it from the host, or failing without --force.
…lected VM min stop --force no longer reports a host-side stop of a VM that is still booting (no VMM pid to signal). The recovery hints carry --vm for a named VM, the RPC-failure arm skips minvmd stop's second guest Shutdown, and the stop reference and --force help describe the host-side fallback.
… 7 on the refusal stop_at reports whether the guest acknowledged Shutdown, and min stop --force prints the data-loss caveat only when it did not: the journal keeps the volume's metadata consistent, not data the guest had not flushed, and the sessions were killed without their stop path. The host-side stop now waits for minvmd to release the alive lock. stop_at writes Stopped itself, so the lifecycle wait returned at once and an immediate min start could find the lock still held. Without --force the unanswering VM is the typed host-unreachable failure, so the run exits 7 instead of 1. A test pins stop_at's guest Shutdown to the passed dir's ssh.sock.
Member
|
/review |
Contributor
|
Approved: no findings at Nothing to do. Clobber: none: |
…e stop min stop's Shutdown RPC used the generic 60 s deadline, so a healthy guest still draining past it was killed from the host at about 85 s, sooner than minvmd stop itself would signal the VMM. On a VM backend the RPC now gets minvmd's own guest Shutdown budget. Also: a VM that went down between the liveness probe and the host-side stop is reported as not running rather than as still booting; a booting VM without --force is told to retry rather than to use --force, which refuses it; and the alive-lock timeout no longer claims a signal that may not have been sent.
Member
|
/review |
norrietaylor
approved these changes
Oct 10, 2026
norrietaylor
deleted the
inbox-patch/wedged-vm-host-stop-d487b4c3bc704bcb
branch
October 10, 2026 09:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABWPGkqg
min stopstopped the daemon only through the in-guest one, so a wedgedguest failed the connect or Shutdown RPC and left the VM running. minvmd
already had a host-side stop that needs no guest; the CLI never used it.
minvmd now exposes it as
stop_at(provider_dir), and on a VM backendmin stop --forcefalls back to it when the connect or the Shutdown RPCfails and the daemon cannot be confirmed down.
stop_atreports whetherthe guest acknowledged Shutdown; only when it did not does the CLI print
the caveat on stderr (sessions killed without their stop path, unflushed
data can be lost, journal keeps metadata consistent). The stop then waits
for minvmd to release the alive lock, so an immediate
min startcannotrace it. Without
--forcethe failure exits 7 (host unreachable) andnames the recovery; a native minimald is unchanged. The
VM-backend gate keys on the provider kind, not the flag alone (flagless
macOS is minvmd-backed), and the guest bridge socket is now resolved from
the state dir being stopped, never minvmd's process-global provider dir.
Verification
cargo fmt --all --check --manifest-path Cargo.toml— cleancargo clippy --workspace --all-targets --locked --manifest-path Cargo.toml -- -D warnings— cleancargo test --locked --manifest-path Cargo.toml -p minvmd -p minimal— newtests
stop_at_signals_vmm_and_stops(minvmd) andstop_force_stops_a_wedged_vm_from_the_host/stop_without_force_on_a_wedged_vm_names_the_recovery(minimal) pass; thefew remaining failures reproduce identically on stock main and are
unrelated to this change.
Summary by CodeRabbit
--force, the VM can now be stopped from the host; without it, the error explains how to recover.