summaryrefslogtreecommitdiff
path: root/vendor/github.com/Microsoft/hcsshim/layerutils.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-01-08 14:52:57 +0100
committerValentin Rothberg <rothberg@redhat.com>2019-01-11 13:38:11 +0100
commitbd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87 (patch)
tree5f06e4e289f16d9164d692590a3fe6541b5384cf /vendor/github.com/Microsoft/hcsshim/layerutils.go
parent545f24421247c9f6251a634764db3f8f8070a812 (diff)
downloadpodman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.tar.gz
podman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.tar.bz2
podman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.zip
vendor: update everything
* If possible, update each dependency to the latest available version. * Use releases over commit IDs and avoid vendoring branches. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/Microsoft/hcsshim/layerutils.go')
-rw-r--r--vendor/github.com/Microsoft/hcsshim/layerutils.go111
1 files changed, 0 insertions, 111 deletions
diff --git a/vendor/github.com/Microsoft/hcsshim/layerutils.go b/vendor/github.com/Microsoft/hcsshim/layerutils.go
deleted file mode 100644
index c0e550377..000000000
--- a/vendor/github.com/Microsoft/hcsshim/layerutils.go
+++ /dev/null
@@ -1,111 +0,0 @@
-package hcsshim
-
-// This file contains utility functions to support storage (graph) related
-// functionality.
-
-import (
- "path/filepath"
- "syscall"
-
- "github.com/sirupsen/logrus"
-)
-
-/* To pass into syscall, we need a struct matching the following:
-enum GraphDriverType
-{
- DiffDriver,
- FilterDriver
-};
-
-struct DriverInfo {
- GraphDriverType Flavour;
- LPCWSTR HomeDir;
-};
-*/
-type DriverInfo struct {
- Flavour int
- HomeDir string
-}
-
-type driverInfo struct {
- Flavour int
- HomeDirp *uint16
-}
-
-func convertDriverInfo(info DriverInfo) (driverInfo, error) {
- homedirp, err := syscall.UTF16PtrFromString(info.HomeDir)
- if err != nil {
- logrus.Debugf("Failed conversion of home to pointer for driver info: %s", err.Error())
- return driverInfo{}, err
- }
-
- return driverInfo{
- Flavour: info.Flavour,
- HomeDirp: homedirp,
- }, nil
-}
-
-/* To pass into syscall, we need a struct matching the following:
-typedef struct _WC_LAYER_DESCRIPTOR {
-
- //
- // The ID of the layer
- //
-
- GUID LayerId;
-
- //
- // Additional flags
- //
-
- union {
- struct {
- ULONG Reserved : 31;
- ULONG Dirty : 1; // Created from sandbox as a result of snapshot
- };
- ULONG Value;
- } Flags;
-
- //
- // Path to the layer root directory, null-terminated
- //
-
- PCWSTR Path;
-
-} WC_LAYER_DESCRIPTOR, *PWC_LAYER_DESCRIPTOR;
-*/
-type WC_LAYER_DESCRIPTOR struct {
- LayerId GUID
- Flags uint32
- Pathp *uint16
-}
-
-func layerPathsToDescriptors(parentLayerPaths []string) ([]WC_LAYER_DESCRIPTOR, error) {
- // Array of descriptors that gets constructed.
- var layers []WC_LAYER_DESCRIPTOR
-
- for i := 0; i < len(parentLayerPaths); i++ {
- // Create a layer descriptor, using the folder name
- // as the source for a GUID LayerId
- _, folderName := filepath.Split(parentLayerPaths[i])
- g, err := NameToGuid(folderName)
- if err != nil {
- logrus.Debugf("Failed to convert name to guid %s", err)
- return nil, err
- }
-
- p, err := syscall.UTF16PtrFromString(parentLayerPaths[i])
- if err != nil {
- logrus.Debugf("Failed conversion of parentLayerPath to pointer %s", err)
- return nil, err
- }
-
- layers = append(layers, WC_LAYER_DESCRIPTOR{
- LayerId: g,
- Flags: 0,
- Pathp: p,
- })
- }
-
- return layers, nil
-}