review: post-batch cleanup round - #35
Merged
Merged
Conversation
create/clone removed the VM dir inline on the resize error path while the cleanupFailedVM defer already removes it; teardownNet was a one-line wrapper around teardownNetContext with a single caller. Behavior unchanged.
Reject unsafe VM names, reconcile daemonized QEMU before offline and destructive operations, retain retryable state on network teardown failure, and serialize stopped-source clones. Align the documentation with the enforced behavior.
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.
Summary
Repo-wide review round after merging #28-#34: style walkthrough, simplify lenses, comment-budget sweep, structural gate, prod-LOC audit, and hot-path check. The batch converged almost clean; this PR applies the three findings that survived adjudication.
os.RemoveAll(dir)on theresizeSystemDiskerror path increate()andclone()— thecleanupFailedVMdefer registered above it already removes the dir (and reaps helpers)teardownNetwrapper intoteardownNetContextand keep the single ctx-takingteardownNetAudit ledger
asl ./...): clean on linux and darwin before and after.resetIncompleteVMDir's committed-record guard was flagged as redundant withscaffoldVM's check, but it sits directly on a destructiveRemoveAlland carries a dedicated test — kept (no change needed).connectFreeNBD's two cleanup blocks differ (one adds--disconnect); folding adds code — kept.storageFromFlag/parseSizesplit is genuine reuse (data disks shareparseSize) — kept.Prod LOC
2803 lines of non-test Go (cmd/vm 1730, qemu 570, cmd/image 337, home 54, internal/procutil 25, version 21). The merged batch added a net +442 (largest: NBD lifecycle +165, transactional create +158), all earned by behavior; this PR returns 9.
Hot path
The batch adds work only to create/teardown paths (per-op flock + lock-dir ensure, create-time NBD lease and /proc scans, one pid verify at launch); nothing on the running-VM path, and this PR only removes work. Hardware re-timing of
vm runis pending testbed availability (both hosts unreachable today) and will ride the next e2e round.Validation
make lint— 0 issues on linux and darwinasl ./...— clean on both GOOSgo test ./...— all packages okgo vet— both GOOS