libvirt: dead code cleanup in libvirt provider #3372
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 221 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.323
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3372"
general
weight: 0.35
mkulke
Four small, independently provable cleanups in the libvirt provider.
All changes are zero-behaviour and zero-risk.
Changes
1. Remove unused
GetDomainCapabilitiesGetDomainCapabilitieswas exported but had no callers anywhere in therepo. Its only call site was removed in commit b8d38b99 (libvirt: Remove
SEV code). This also removes the last use of
ConnectGetDomainCapabilitiesFlagsin the package.2. Use
archX86_64constant increateDomainXMLx86_64createDomainXMLx86_64hardcoded the string"x86_64"directly in theDomainOSTypestruct, while the s390x and aarch64 builders already usetheir
archS390xandarchAArch64constants. This makes all threebuilders symmetric.
3. Retype and use
defaultCPU/defaultMemoryconstantsBoth were declared as string constants (
"2","8192") butParseCmdpassed bare integer literals to
UintWithEnvinstead of referencingthem. Every other default in the const block is wired to its flag.
Retyped to
uintto matchConfig.CPU/Config.Memoryand referencedin
ParseCmd.Also adds the missing
//go:build cgotag tomanager_test.go— everyother test file in the package carries this tag; the omission caused
CGO_ENABLED=0 go test ./...to fail to compile.4. Remove unused
dataDirandvolNamefields fromlibvirtClientlibvirtClient.dataDirandlibvirtClient.volNamewere set inNewLibvirtClientbut never read anywhere in the package.Config.DataDir,Config.VolName, andvmConfig.volNameare separatefields on different structs that remain fully in use — only the dead
shadow copies on
libvirtClientare removed.Testing
No behaviour change — existing tests cover all modified code paths.