mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
libpod: split out cgroups call into linux specific file
So that we do not cause compile error on freebsd. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -23,7 +23,6 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/containers/common/pkg/cgroups"
|
|
||||||
"github.com/containers/common/pkg/config"
|
"github.com/containers/common/pkg/config"
|
||||||
"github.com/containers/common/pkg/detach"
|
"github.com/containers/common/pkg/detach"
|
||||||
"github.com/containers/common/pkg/resize"
|
"github.com/containers/common/pkg/resize"
|
||||||
@ -1100,7 +1099,7 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ctr.config.CgroupsMode == cgroupSplit {
|
if ctr.config.CgroupsMode == cgroupSplit {
|
||||||
if err := cgroups.MoveUnderCgroupSubtree("runtime"); err != nil {
|
if err := moveToRuntimeCgroup(); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,3 +28,7 @@ func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func moveToRuntimeCgroup() error {
|
||||||
|
return errors.New("moveToRuntimeCgroup not supported on freebsd")
|
||||||
|
}
|
||||||
|
@ -326,3 +326,7 @@ func GetLimits(resource *spec.LinuxResources) (runcconfig.Resources, error) {
|
|||||||
final.Unified = resource.Unified
|
final.Unified = resource.Unified
|
||||||
return *final, nil
|
return *final, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func moveToRuntimeCgroup() error {
|
||||||
|
return cgroups.MoveUnderCgroupSubtree("runtime")
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user