mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
8ddd892072
`configs.Cgroup` contains the configuration used to create cgroups. This configuration must be saved to disk, since it's required to restore the cgroup manager that was used to create the cgroups. Add method to get cgroup configuration from cgroup Manager to allow API users save it to disk and restore a cgroup manager later. fixes #2176 Signed-off-by: Julio Montes <julio.montes@intel.com>
68 lines
1.5 KiB
Go
68 lines
1.5 KiB
Go
// +build !linux
|
|
|
|
package systemd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/opencontainers/runc/libcontainer/cgroups"
|
|
"github.com/opencontainers/runc/libcontainer/configs"
|
|
)
|
|
|
|
type Manager struct {
|
|
Cgroups *configs.Cgroup
|
|
Paths map[string]string
|
|
}
|
|
|
|
func UseSystemd() bool {
|
|
return false
|
|
}
|
|
|
|
func NewSystemdCgroupsManager() (func(config *configs.Cgroup, paths map[string]string) cgroups.Manager, error) {
|
|
return nil, fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) Apply(pid int) error {
|
|
return fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) GetPids() ([]int, error) {
|
|
return nil, fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) GetAllPids() ([]int, error) {
|
|
return nil, fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) Destroy() error {
|
|
return fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) GetPaths() map[string]string {
|
|
return nil
|
|
}
|
|
|
|
func (m *Manager) GetUnifiedPath() (string, error) {
|
|
return "", fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) GetStats() (*cgroups.Stats, error) {
|
|
return nil, fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) Set(container *configs.Config) error {
|
|
return fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) Freeze(state configs.FreezerState) error {
|
|
return fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func Freeze(c *configs.Cgroup, state configs.FreezerState) error {
|
|
return fmt.Errorf("Systemd not supported")
|
|
}
|
|
|
|
func (m *Manager) GetCgroups() (*configs.Cgroup, error) {
|
|
return nil, fmt.Errorf("Systemd not supported")
|
|
}
|