Pass disk handle for computestorage.FormatWritableLayerVhd on RS5#1204
Merged
dcantah merged 2 commits intomicrosoft:masterfrom Nov 6, 2021
Merged
Pass disk handle for computestorage.FormatWritableLayerVhd on RS5#1204dcantah merged 2 commits intomicrosoft:masterfrom
dcantah merged 2 commits intomicrosoft:masterfrom
Conversation
378d627 to
8b76d52
Compare
On RS5 the HcsFormatWritableLayerVhd call expects to receive a disk handle. On 19h1+ you can pass a vhd handle and internally they will do the same work we're doing in this change to grab a disk handle to perform the format. Signed-off-by: Daniel Canter <[email protected]>
8b76d52 to
ee0f993
Compare
kevpar
reviewed
Oct 21, 2021
Contributor
Author
|
@helsaawy Wanna take a look at this one? :) |
Fix DetachVHD error check and assignment. Signed-off-by: Daniel Canter <[email protected]>
56bb91d to
44b7ee9
Compare
Contributor
|
lgtm 👍 |
helsaawy
approved these changes
Oct 22, 2021
| if err != nil { | ||
| return err | ||
| } | ||
| defer windows.CloseHandle(diskHandle) // nolint: errcheck |
There was a problem hiding this comment.
why do we need to close this handle but we don't close the handle that's created if this section of code doesn't run?
Contributor
Author
There was a problem hiding this comment.
We don't handle closing the vhd handle passed in as it's expected the caller will close it. This function owns this new disk handle essentially so we need to close it ourselves if we hit this path.
katiewasnothere
approved these changes
Nov 6, 2021
anmaxvl
pushed a commit
to anmaxvl/hcsshim
that referenced
this pull request
Nov 17, 2021
Related work items: microsoft#1067, microsoft#1097, microsoft#1119, microsoft#1170, microsoft#1176, microsoft#1180, microsoft#1181, microsoft#1182, microsoft#1183, microsoft#1184, microsoft#1185, microsoft#1186, microsoft#1187, microsoft#1188, microsoft#1189, microsoft#1191, microsoft#1193, microsoft#1194, microsoft#1195, microsoft#1196, microsoft#1197, microsoft#1200, microsoft#1201, microsoft#1202, microsoft#1203, microsoft#1204, microsoft#1205, microsoft#1206, microsoft#1207, microsoft#1209, microsoft#1210, microsoft#1211, microsoft#1218, microsoft#1219, microsoft#1220, microsoft#1223
dcantah
added a commit
to dcantah/hcsshim
that referenced
this pull request
Aug 1, 2022
… RS5 (microsoft#1204)" This reverts commit aaf5db9. We'd added a change to FormatWritableLayerVhd to help the caller work around a breaking change in the OS, but this would actually cause a breaking change in our wrapper of it if the caller was already working around the issue themselves. To avoid this scenario, revert the commit that added the "friendly" behavior. Signed-off-by: Daniel Canter <[email protected]>
dcantah
added a commit
to dcantah/hcsshim
that referenced
this pull request
Aug 3, 2022
… RS5 (microsoft#1204)" This reverts commit aaf5db9. We'd added a change to FormatWritableLayerVhd to help the caller work around a breaking change in the OS, but this would actually cause a breaking change in our wrapper of it if the caller was already working around the issue themselves. To avoid this scenario, revert the commit that added the "friendly" behavior. Signed-off-by: Daniel Canter <[email protected]>
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.
On RS5 the HcsFormatWritableLayerVhd call expects to receive a disk handle.
On 19h1+ you can pass a vhd handle and internally they will do the same
work we're doing in this change to grab a disk handle to perform the format.
Signed-off-by: Daniel Canter [email protected]