pkg/driver/qemu: use fresh help buffers per command in inspectFeatures #5886
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 · 225 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.324
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5886"
general
weight: 0.35
AkihiroSuda
What This PR Changes
Allocate fresh
stdoutandstderrbuffers per command via a smallinspectHelphelper inpkg/driver/qemu/qemu.go:-accel help,-netdev help,-machine help, and-cpu helpoutputs from accumulating or overwriting prior slices viabytes.Buffer.Bytes()backing-array reuse.stderrfallback when an earlier command wrote tostdout.%wsologrus.Warnreports only that command's ownstdout/stderr.Adds
TestInspectFeaturesunit tests inpkg/driver/qemu/qemu_test.go.Linked Issue (Required in most cases)
N/A (isolated bug fix in
pkg/driver/qemu/qemu.gowith unit tests; no existing issue).How I Tested This
Unit tests, cross-compile test builds, linters, and build on Linux Mint 22.3 (
x86_64, QEMU 8.2.2):3268d9b3,TestInspectFeaturesfails becauseNetdevHelp/CPUHelpcontain prior commands' output andstderrfallback is masked. With the fix, all tests and linters pass (0issues).Real
limactlverification (vmOpts.qemu.cpuType.x86_64: vhost-user— a-netdev helpstring):3268d9b3): passed Lima'sCPUHelpcheck and launched QEMU (qemu-system-x86_64: unable to find CPU model 'vhost-user').qemu.Cmdlinebefore launching QEMU (ha.stderr.log: `cpuvhost-useris not supported by /usr/bin/qemu-system-x86_64`).AI Usage
Assisted-by: Gemini