Repository navigation
blockcim config and plugin initialization changes - #13469
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adjusts Block CIM feature gating on Windows and changes scratch VHD creation defaults to avoid NTFS formatting unless explicitly requested.
Changes:
- Default scratch VHD creation now skips NTFS formatting unless
WithNTFSFormat()is provided. - Base differencing scratch VHD creation explicitly requests NTFS formatting.
- Block CIM snapshotter/differ plugin checks updated to
IsBlockCimWriteSupported().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| plugins/snapshots/windows/cimfs.go | Changes default scratch VHD formatting behavior and makes base VHD formatting explicit. |
| plugins/snapshots/windows/block_cimfs.go | Updates Block CIM support gate to require write support. |
| plugins/diff/windows/cimfs.go | Updates Block CIM support gate in diff plugin to require write support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func defaultScratchCreationOptions() *scratchCreationOptions { | ||
| return &scratchCreationOptions{ | ||
| ntfsFormat: true, | ||
| ntfsFormat: false, | ||
| sizeInBytes: defaultScratchVHDSizeInBytes, | ||
| } | ||
| } |
| func defaultScratchCreationOptions() *scratchCreationOptions { | ||
| return &scratchCreationOptions{ | ||
| ntfsFormat: true, | ||
| ntfsFormat: false, | ||
| sizeInBytes: defaultScratchVHDSizeInBytes, | ||
| } | ||
| } |
6a1bc1b to
22615f6
Compare
22615f6 to
9c375b4
Compare
| return &scratchCreationOptions{ | ||
| ntfsFormat: true, | ||
| ntfsFormat: false, | ||
| sizeInBytes: defaultScratchVHDSizeInBytes, | ||
| } |
| if !baseVHDExists { | ||
| if err = createScratchVHD(ctx, baseVHDPath); err != nil { | ||
| if err = createScratchVHD(ctx, baseVHDPath, WithNTFSFormat()); err != nil { | ||
| return fmt.Errorf("failed to create base vhd: %w", err) | ||
| } | ||
| } |
| if !cimfs.IsBlockCimWriteSupported() { | ||
| return nil, fmt.Errorf("host OS doesn't support writable block CIMs: %w", plugin.ErrSkipPlugin) |
This change updates an incorrect default config value for the block CIM snapshotter. The `ntfsFormat` should always be false for the block CIM snapshotter. If the scratch needs to be formatted with NTFS, a format option named `WithNTFSFormat` can be provided. Signed-off-by: Amit Barve <[email protected]>
Switch block CIM snapshotter and diff plugin init checks from IsBlockCimSupported() to IsBlockCimWriteSupported() to allow plugins to load when the CimWriter.dll is available, even on OS builds without native block CIM support. Signed-off-by: Maksim An <[email protected]>
9c375b4 to
5ae5d99
Compare
|
@thaJeztah maybe? |
cpuguy83
left a comment
There was a problem hiding this comment.
Both changes look reasonable to me, though I'd defer to the author on intent.
Commit 1 (ntfsFormat default true → false) seems to address a real issue: with the old true default, the UnformattedScratch paths (block_cimfs.go:116 and :373) appear to have been getting NTFS-formatted despite the config name and docs suggesting they shouldn't be. Flipping the default to false and adding the explicit WithNTFSFormat() on the cimfs base VHD looks like it preserves the formatted path while fixing the unformatted ones — at least that's how I read the three call sites.
Commit 2 (IsBlockCimSupported() → IsBlockCimWriteSupported()) seems aligned with the pull scenario, and it's consistent with how hcsshim's own writer gates itself. That part feels sound.
One thing I'd want confirmed rather than assume: gating snapshotter init on write support means mount support is no longer guaranteed at init time. On a host with CimWriter but an older OS, mounting would presumably fail later at runtime instead of being skipped up front. That may well be the intended trade-off for pull, but it might be worth a sanity check.
This review was produced by Claude Opus 4.8.
cpuguy83
left a comment
There was a problem hiding this comment.
LGTM given assumptions in my review comment are good.
This change updates an incorrect default config value for the block CIM
snapshotter. The
ntfsFormatshould always be false for the block CIMsnapshotter. If the scratch needs to be formatted with NTFS, a format
option named
WithNTFSFormatcan be provided.Original PR: #12439
Switch block CIM snapshotter and diff plugin init checks from
IsBlockCimSupported() to IsBlockCimWriteSupported() to allow plugins
to load when the CimWriter.dll is available, even on OS builds
without native block CIM support.