Repository navigation
[17.0-stable] kvm: honour the force flag when stopping a domain - #6490
Merged
eriknordmark merged 1 commit intoSep 10, 2026
Merged
eriknordmark merged 1 commit into
eriknordmark merged 1 commit into
Conversation
A forced stop was the same ACPI poweroff request as a graceful one, which a guest that cannot service it yet - one still early in boot, for instance - simply ignores. Nothing then made the domain go away until domainmgr gave up waiting and deleted it, so an application stopped shortly after it started stayed reported as halting for as long as those waits took, and its memory and any assigned devices stayed held. A forced stop now terminates the process, which is what the interface promises and what the xen and containerd implementations of the same method already do. The termination path Delete already used, a monitor quit followed by a kill if that does not take, is shared rather than duplicated. Termination reports whether it worked, so a stop that could not make the process go away - an unusable pid file leaving nothing to signal, or a process that outlives the SIGKILL - reaches the caller rather than only the log, and domainmgr's Shutdown(force) succeeded line means what it says. Delete carries the same outcome, so a domain whose process is still there is not reported as deleted just because its state directory was removed. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit dbb5dc5)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 17.0-stable #6490 +/- ##
===============================================
+ Coverage 21.38% 21.80% +0.41%
===============================================
Files 500 510 +10
Lines 92650 94360 +1710
===============================================
+ Hits 19813 20572 +759
- Misses 71191 71958 +767
- Partials 1646 1830 +184 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rene
approved these changes
Sep 9, 2026
This was referenced Sep 16, 2026
3 of 6 tasks
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.
Description
Backport of #6441 to
17.0-stable.A forced stop was the same ACPI poweroff request as a graceful one, which a guest
that cannot service it yet — one still early in boot, for instance — simply
ignores. Nothing then made the domain go away until domainmgr gave up waiting and
deleted it, so an application stopped shortly after it started stayed reported as
halting for as long as those waits took, and its memory and any assigned devices
stayed held. A forced stop now terminates the process, as the xen and containerd
implementations of the same method already do, and reports whether that worked so
a process that outlives the SIGKILL reaches the caller rather than only the log.
The pillar commit is cherry-picked with
-xand applied cleanly. The source PR'ssecond commit,
evetest: halt a guest which ignores ACPI, is not carried:evetest/tests/appsdoes not exist on this branch, so the test has no suite tojoin.
How to test and validate this PR
go test ./hypervisor/inpkg/pillar—kvm_force_test.gocovers the forcedpath, including the pid-file and surviving-process failures.
go build ./...andgo vet ./hypervisor/are clean on this branch.On a device, stop an application a few seconds after starting it, while the guest
is still early in boot and ignoring ACPI. The domain goes away promptly instead of
staying in halting until domainmgr's wait expires, and its memory and any assigned
PCI devices are released at that point.
Changelog notes
An application stopped while its guest is still booting now halts promptly
instead of staying in a halting state until the shutdown wait expires.
PR Backports
Checklist