Skip to content

Commit

Permalink
Merge pull request #893 from dcantah/use-computestorage
Browse files Browse the repository at this point in the history
Change CreateNTFSVHD to use computestorage call
  • Loading branch information
dcantah authored Nov 9, 2020
2 parents 1432f9c + 36c772f commit 3cc00bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 61 deletions.
5 changes: 0 additions & 5 deletions internal/hcs/syscall.go

This file was deleted.

5 changes: 3 additions & 2 deletions internal/hcs/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/Microsoft/go-winio"
diskutil "github.com/Microsoft/go-winio/vhd"
"github.com/Microsoft/hcsshim/computestorage"
"github.com/pkg/errors"
"golang.org/x/sys/windows"
)
Expand Down Expand Up @@ -36,7 +37,7 @@ func makeOpenFiles(hs []syscall.Handle) (_ []io.ReadWriteCloser, err error) {
return fs, nil
}

// creates a VHD formatted with NTFS of size `sizeGB` at the given `vhdPath`.
// CreateNTFSVHD creates a VHD formatted with NTFS of size `sizeGB` at the given `vhdPath`.
func CreateNTFSVHD(ctx context.Context, vhdPath string, sizeGB uint32) (err error) {
if err := diskutil.CreateVhdx(vhdPath, sizeGB, 1); err != nil {
return errors.Wrap(err, "failed to create VHD")
Expand All @@ -53,7 +54,7 @@ func CreateNTFSVHD(ctx context.Context, vhdPath string, sizeGB uint32) (err erro
}
}()

if err := hcsFormatWritableLayerVhd(uintptr(vhd)); err != nil {
if err := computestorage.FormatWritableLayerVhd(ctx, windows.Handle(vhd)); err != nil {
return errors.Wrap(err, "failed to format VHD")
}

Expand Down
54 changes: 0 additions & 54 deletions internal/hcs/zsyscall_windows.go

This file was deleted.

0 comments on commit 3cc00bc

Please sign in to comment.