...
1
2
3 package computestorage
4
5 import (
6 "context"
7
8 "github.com/Microsoft/hcsshim/internal/interop"
9 "github.com/Microsoft/hcsshim/internal/oc"
10 "github.com/pkg/errors"
11 "golang.org/x/sys/windows"
12 )
13
14
15 func GetLayerVhdMountPath(ctx context.Context, vhdHandle windows.Handle) (path string, err error) {
16 title := "hcsshim::GetLayerVhdMountPath"
17 ctx, span := oc.StartSpan(ctx, title)
18 defer span.End()
19 defer func() { oc.SetSpanStatus(span, err) }()
20
21 var mountPath *uint16
22 err = hcsGetLayerVhdMountPath(vhdHandle, &mountPath)
23 if err != nil {
24 return "", errors.Wrap(err, "failed to get vhd mount path")
25 }
26 path = interop.ConvertAndFreeCoTaskMemString(mountPath)
27 return path, nil
28 }
29
View as plain text