Repository navigation
[16.0-stable] kvm: honour the force flag when stopping a domain - #6843
Merged
eriknordmark merged 1 commit intoOct 19, 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) Signed-off-by: Milan Lenco <milan@zededa.com>
milan-zededa
requested review from
rene,
rouming,
rucoder and
shjala
as code owners
October 18, 2026 17:41
4 of 7 tasks
rene
approved these changes
Oct 18, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 16.0-stable #6843 +/- ##
===============================================
- Coverage 29.12% 26.89% -2.24%
===============================================
Files 10 25 +15
Lines 1133 4332 +3199
===============================================
+ Hits 330 1165 +835
- Misses 768 2938 +2170
- Partials 35 229 +194 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 30, 2026
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
16.0-stable.Cherry-picked with
-xfromdbb5dc5e52. Only the pillar commit of the PR isbackported; its evetest commit is part of the evetest backport (#6842).
The cherry-pick needed conflict resolution in
pkg/pillar/hypervisor/kvm.go,because
StopandDeletelook different in 16.0:terminateQemulogic (and the unit testkvm_force_test.go) istaken as is, and
Deletekeeps the error joining that 16.0 already has;decideKvmState, which comes from an unrelated change that is not in16.0, is not brought over;
procutilscall is replaced with theutilspackage that 16.0 has,and the
errorsandsyscallimports are added.Without this fix
TestHaltUnresponsiveGuestfails: a guest that ignores theACPI power-off request is not force-stopped.
PR dependencies
None.
How to test and validate this PR
Covered by the evetest test
TestHaltUnresponsiveGuest(added to16.0-stableby #6842):Changelog notes
Fixed forced stop and deletion of an application whose guest ignores the ACPI power-off request: the QEMU process is now killed if it does not exit.
Checklist
For backport PRs (remove it if it's not a backport):
And the last but not least:
check them.