Skip to content

Unify vGPU retention wrapping and dedupe test fixtures - #466

Merged
yummybomb merged 1 commit into
hypeship/vendor-vfio-vgpufrom
hypeship/deslop-vendor-vfio-vgpu
Aug 28, 2026
Merged

yummybomb merged 1 commit into
hypeship/vendor-vfio-vgpufrom
hypeship/deslop-vendor-vfio-vgpu

Conversation

@yummybomb

Copy link
Copy Markdown
Contributor

Summary

Cleanup pass on the vendor VFIO vGPU lifecycle layer (#321), no behavior change:

  • One retention mechanism in start. The start-path rollback for a failed vGPU create previously hand-built VGPUCleanupPendingError in two places instead of going through vgpuRetention like create does. The branch now records retention via markRetained and lets the existing deferred wrapPending produce the error, so the pending-error construction and the retained/unretained metric each live in one place. Error text, Retained flag, metric values, and wrapping order are unchanged.
  • Inlined deferWrapPending. It was a one-line adapter around wrapPending; the ordering constraint it documented belongs at the two call sites, which now carry it.
  • Deduped test fixtures. The identical 5-field vendor VFIO VGPUDevice literal appeared three times in vgpu_test.go; extracted testVendorVFIODevice.

Reviewed the rest of the diff for dead branches and redundant tests and deliberately left it alone: the per-callsite retention-stub rejection tests match the four independent guards, the reconcile tests each cover a distinct fail-closed path, and the interface{ StartVGPUReconciler } assertion in cmd/api/main.go follows the file's existing idiom for optional manager methods.

Testing

  • go build ./..., go vet ./... clean
  • go test -race passes for lib/devices, lib/hypervisor/qemu, and the lib/instances vGPU/retention/reconcile/lifecycle suites
  • cmd/api/api and lib/instances integration failures in this environment are identical on the unmodified base branch (network/hypervisor privileges), per-test diff verified

@yummybomb

Copy link
Copy Markdown
Contributor Author

Closing because this cleanup commit was pushed directly onto #321.

@yummybomb
yummybomb merged commit 8093307 into hypeship/vendor-vfio-vgpu Aug 28, 2026
3 of 4 checks passed
@yummybomb
yummybomb deleted the hypeship/deslop-vendor-vfio-vgpu branch August 28, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant