Repository navigation
[14.5-stable] kvm force stop, evetpm and unit-test fixes - #6996
Merged
rene merged 7 commits intoOct 31, 2026
Merged
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> (cherry picked from commit f7f4757)
When the vault key is fetched, a TPM error while checking for the sealed disk key was read as "no key present", so EVE generated and sealed a fresh key over the existing one. Data encrypted with the old key, such as a reused etcd zvol after a kvm-to-k vault migration redo, then could not be opened by any key. The check now distinguishes an undefined NV index from a TPM error, retries the error twice with a log line per attempt, and fails the fetch rather than generating a key if it persists. An index that is defined but never written still counts as absent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: eriknordmark <erik@zededa.com> (cherry picked from commit e3969c3)
Fetching the vault key must not take a TPM error for an absent key, or it seals a fresh key over the one the vault is encrypted with. The tests put a proxy between EVE and the TPM simulator that fails the disk-key presence check while every other command, sealing included, keeps working. A transient failure must yield the sealed key, and a persistent one an error with the sealed key left in place. Against the earlier presence check, the transient case replaces the key. The proxy answers TPM_RC_NV_UNAVAILABLE rather than TPM_RC_RETRY because go-tpm retries TPM_RC_RETRY itself and never returns it to the caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: eriknordmark <erik@zededa.com> (cherry picked from commit aaaaab0)
TestSingleEthInterface and TestSingleEthInterfaceWithIPv6 failed intermittently on loaded CI runners, with DNS servers still reported after the interface lost its addresses. One simulated interface update publishes address, DNS and route events, and the first of them wakes the test. The reconciler's watcher picks randomly between a queued event and the pause request from Reconcile, so Reconcile could run before the DNS change was processed and skip the DNS state. Wait until the watcher has received every published event before reconciling. The mock network monitor reports the number of events still queued for its subscribers for this purpose. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 5c2a208)
TestManageStatFileSizeTargetSizesAvgThreshold asserted that rewriting a 6.8 MB stat file takes under 5 s. Under -race on a loaded CI runner it sometimes does not, failing the test although the trimmed file is correct. The test checks the result, which is what it is for; log the duration and drop the bound. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 30428f1)
Probe latency is measured in real time around the mock's simulated RTT, so a slow scheduler only inflates it, and the fixed headroom the tests allowed was exceeded on loaded CI runners. A probe that outlasts UserProbeTimeout fails instead of reporting latency, so use that as the upper bound. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 50fd414)
The send and verify tests reached google.com and postman-echo.com, so a slow resolver or a CI runner without Internet access failed them; a 5 s DNS timeout did so on CI. Serve them from an httptest TLS server bound to the port's IPv4 address instead. The URL is an IP literal, so these tests no longer exercise DNS resolution. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit b81f434)
This was referenced Oct 30, 2026
github-actions
Bot
requested review from
OhmSpectator,
christoph-zededa,
milan-zededa,
rene,
rouming,
rucoder and
shjala
October 30, 2026 19:09
eriknordmark
removed request for
OhmSpectator,
christoph-zededa,
rucoder and
shjala
October 30, 2026 19:10
eriknordmark
marked this pull request as ready for review
October 30, 2026 20:36
eriknordmark
requested review from
christoph-zededa,
rucoder and
shjala
as code owners
October 30, 2026 20:36
This was referenced Oct 30, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 14.5-stable #6996 +/- ##
===============================================
+ Coverage 24.97% 26.98% +2.00%
===============================================
Files 8 14 +6
Lines 1185 2898 +1713
===============================================
+ Hits 296 782 +486
- Misses 820 1958 +1138
- Partials 69 158 +89 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rene
approved these changes
Oct 31, 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, #6691, #6953 to
14.5-stable, combined into one PR to saveCI runs. Every commit is cherry-picked with
-x, in master merge order:app whose guest ignores the ACPI power-off request now kills the QEMU
process instead of leaving the app running.
at boot no longer makes EVE replace the vault's disk key with a new one.
Adaptations:
16.0-stablebackport [16.0-stable] kvm: honour the force flag when stopping a domain #6843 (commitf7f47576d),whose
kvm.gobase differs from this branch's by one unrelated line; thediff is identical to [16.0-stable] kvm: honour the force flag when stopping a domain #6843's. As there, only the pillar commit is taken, not
the evetest one.
change on master, so the hunks are applied by hand. The added and removed
lines are master's, except that
tpm.gogains theerrorsimport, andCompareLegacyandSealedKey, which takes no logger on this branch, reads aTPM error as no sealed key without logging it, as before. The test helper
sealTestDiskKeydoes not callextendFirmwareAnchorPCRs, which comes withevetpm: refuse to seal the vault key against all-zero firmware PCRs (defense in depth) #6162 and is not on this branch.
fake clock" need Go 1.25's
testing/synctest; "dpcmanager: stabilize thefallback-to-manual test" and "dpcmanager: wait for the right DPC in PNAC
tests" fix tests that do not exist on this branch. In "controllerconn: send
tests use a local server", the hunks for
send_multiport_test.goandTestVerifyAllIntf_Accept4xxErrorsare dropped, as neither exists here.PR dependencies
None.
How to test and validate this PR
gofmt,go build ./...(with and without-tags k),go vetandgo testof every touched pillar package pass on this branch.kvm_force_test.gocoversterminateQemu, which the forced stop calls.TestTerminateQemuKillsWhenMonitorUnreachablefails with its SIGKILLremoved.
tests/tpm/prep-and-run.sh).TestDiskKeyPresentFailsOnTPMErrorfails on this branch whendiskKeyPresenttreats a TPM error as an absent key again.
Changelog notes
ACPI power-off request: the QEMU process is now killed if it does not exit.
new one.
PR Backports
Checklist
device testing is on the source PRs.
For backport PRs:
I've added a reference link to the original PR
PR's title follows the template
I've checked the boxes above, or I've provided a good reason why I didn't
check them.
🤖 Generated with Claude Code