Repository navigation
[13.4-stable] domainmgr: bound the graceful stop wait for default-mode guests - #6475
Merged
eriknordmark merged 1 commit intoSep 8, 2026
Conversation
An application whose configuration leaves the virtualization mode unset gets PV, the zero value of the mode enum. Only xen acts on that mode; under kvm or kubevirt such a guest is an ordinary one that happens to have defaulted, yet deactivating it granted the ACPI poweroff request the entire ten-minute budget before anything else was tried. A guest that cannot service the request yet, one still early in boot for instance, therefore stayed reported as halting for that whole period, holding its memory and any assigned devices, even though the forced stop and the delete that follow would have freed it in seconds. Such a guest now gets the same one-minute wait an HVM or FML guest already gets, after which the stop escalates as before. A xen PV guest keeps the full budget: there the mode names a real paravirtualized guest whose tools are inherent, so a slow but cooperative shutdown is worth waiting out. The decision moves into shutdownBudget, which reports whether a poweroff request is sent at all and how long it is given, so it can be exercised directly. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit b66b004)
7 of 9 tasks
github-actions
Bot
requested review from
OhmSpectator,
jsfakian,
milan-zededa and
uncleDecart
September 7, 2026 14:58
This was referenced Sep 7, 2026
4 of 6 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 13.4-stable #6475 +/- ##
===============================================
+ Coverage 24.78% 32.66% +7.88%
===============================================
Files 8 9 +1
Lines 1138 1090 -48
===============================================
+ Hits 282 356 +74
+ Misses 788 654 -134
- Partials 68 80 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
milan-zededa
approved these changes
Sep 8, 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 #6453 to
13.4-stable.An application whose configuration leaves the virtualization mode unset gets
PV, the zero value of the mode enum. Only xen acts on that mode; under kvm orkubevirt such a guest is an ordinary one which happens to have defaulted. Yet
deactivating it granted the ACPI poweroff request the entire ten-minute budget
before anything else was tried, because the
PVcase indoInactivatesetsdoShutdownwithout loweringfirstDelayfrommaxDelaythe wayHVMandFMLdo. A guest which cannot service the request yet -- one still early inboot, for instance -- therefore stayed reported as halting for that whole
period, holding its memory and any assigned devices.
Such a guest now gets the same one-minute wait an
HVMorFMLguest alreadygets, after which the stop escalates exactly as before. A xen
PVguest keepsthe full budget, where the mode names a real paravirtualized guest whose tools
are inherent.
Cherry-picked with
-xfromb66b0040c, no adaptations: the pick appliedclean, and every added and removed line is identical to the master commit's --
the only difference against it is hunk-header line numbers. The buggy
switchblock on this branch was character-identical to master's before the fix.
The second commit of #6453 is not backported. It adds an evetest test, and
evetest/does not exist on this branch, so backporting it would meanbackporting the harness. The regression stays guarded here by the unit test
that ships in the cherry-picked commit.
PR dependencies
None.
How to test and validate this PR
TestShutdownBudgetinpkg/pillar/cmd/domainmgrcovers all eightmode/hypervisor combinations. On this branch
go build ./...,go vet ./cmd/domainmgr/and the fulldomainmgrtest suite pass, andgofmt -lis clean.Validated against un-fixed code on 13.4-stable, the most divergent of the four
targets: reverting the
PVarm toreturn true, maxDelayfails exactly thetwo rows this change affects,
PV under kvmandPV under kubevirt, withfirstDelay = 10m0s, want 1m0s, while both xen rows and theHVM,FML,NOHYPERandLEGACYrows still pass.End-to-end device measurements are in #6453: 637/636/637 s from deactivation to
HALTED before the fix against 98/95/96 s after, and 85 runs over 8 hours with
no outlier.
Changelog notes
An application which is stopped very shortly after it starts is no longer held
for ten minutes before it is reported as stopped.
PR Backports
Checklist
the budgets are internal to
doInactivate.architecture independent.
For backport PRs:
check them.