Update Windows runtime to use snapshotter and differ layers

This changes the Windows runtime to use the snapshotter and differ
created layers, and updates the ctr commands to use the snapshotter and differ.

Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
Darren Stahl
2018-01-05 13:30:26 -08:00
parent a5a9f91832
commit dcff993653
9 changed files with 92 additions and 318 deletions

View File

@@ -39,11 +39,6 @@ func (m *Mount) Mount(target string) error {
if err = hcsshim.PrepareLayer(di, layerID, parentLayerPaths); err != nil {
return errors.Wrapf(err, "failed to prepare layer %s", m.Source)
}
defer func() {
if err != nil {
hcsshim.UnprepareLayer(di, layerID)
}
}()
return nil
}
@@ -67,10 +62,12 @@ func (m *Mount) GetParentPaths() ([]string, error) {
// Unmount the mount at the provided path
func Unmount(mount string, flags int) error {
home, layerID := filepath.Split(mount)
var di = hcsshim.DriverInfo{
HomeDir: home,
}
var (
home, layerID = filepath.Split(mount)
di = hcsshim.DriverInfo{
HomeDir: home,
}
)
if err := hcsshim.UnprepareLayer(di, layerID); err != nil {
return errors.Wrapf(err, "failed to unprepare layer %s", mount)