activatelayer.go 842 B

12345678910111213141516171819202122232425262728
  1. package hcsshim
  2. import "github.com/Sirupsen/logrus"
  3. // ActivateLayer will find the layer with the given id and mount it's filesystem.
  4. // For a read/write layer, the mounted filesystem will appear as a volume on the
  5. // host, while a read-only layer is generally expected to be a no-op.
  6. // An activated layer must later be deactivated via DeactivateLayer.
  7. func ActivateLayer(info DriverInfo, id string) error {
  8. title := "hcsshim::ActivateLayer "
  9. logrus.Debugf(title+"Flavour %d ID %s", info.Flavour, id)
  10. infop, err := convertDriverInfo(info)
  11. if err != nil {
  12. logrus.Error(err)
  13. return err
  14. }
  15. err = activateLayer(&infop, id)
  16. if err != nil {
  17. err = makeErrorf(err, title, "id=%s flavour=%d", id, info.Flavour)
  18. logrus.Error(err)
  19. return err
  20. }
  21. logrus.Debugf(title+" - succeeded id=%s flavour=%d", id, info.Flavour)
  22. return nil
  23. }