From b30f280d2f424e0b51a0374201a9cd481bffbf36 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 14 May 2014 15:21:44 -0700 Subject: [PATCH] Move cgroups package into libcontainer Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) --- {cgroups => libcontainer/cgroups}/MAINTAINERS | 0 {cgroups => libcontainer/cgroups}/cgroups.go | 0 {cgroups => libcontainer/cgroups}/cgroups_test.go | 0 {cgroups => libcontainer/cgroups}/fs/apply_raw.go | 2 +- {cgroups => libcontainer/cgroups}/fs/blkio.go | 2 +- {cgroups => libcontainer/cgroups}/fs/blkio_test.go | 0 {cgroups => libcontainer/cgroups}/fs/cpu.go | 0 {cgroups => libcontainer/cgroups}/fs/cpu_test.go | 0 {cgroups => libcontainer/cgroups}/fs/cpuacct.go | 2 +- {cgroups => libcontainer/cgroups}/fs/cpuset.go | 0 {cgroups => libcontainer/cgroups}/fs/devices.go | 0 {cgroups => libcontainer/cgroups}/fs/freezer.go | 2 +- {cgroups => libcontainer/cgroups}/fs/memory.go | 0 {cgroups => libcontainer/cgroups}/fs/memory_test.go | 0 {cgroups => libcontainer/cgroups}/fs/perf_event.go | 2 +- {cgroups => libcontainer/cgroups}/fs/test_util.go | 0 {cgroups => libcontainer/cgroups}/fs/utils.go | 0 {cgroups => libcontainer/cgroups}/fs/utils_test.go | 0 .../cgroups}/systemd/apply_nosystemd.go | 3 ++- {cgroups => libcontainer/cgroups}/systemd/apply_systemd.go | 2 +- {cgroups => libcontainer/cgroups}/utils.go | 0 libcontainer/container.go | 2 +- libcontainer/nsinit/exec.go | 6 +++--- libcontainer/nsinit/unsupported.go | 2 +- sysinfo/sysinfo.go | 3 ++- 25 files changed, 15 insertions(+), 13 deletions(-) rename {cgroups => libcontainer/cgroups}/MAINTAINERS (100%) rename {cgroups => libcontainer/cgroups}/cgroups.go (100%) rename {cgroups => libcontainer/cgroups}/cgroups_test.go (100%) rename {cgroups => libcontainer/cgroups}/fs/apply_raw.go (98%) rename {cgroups => libcontainer/cgroups}/fs/blkio.go (97%) rename {cgroups => libcontainer/cgroups}/fs/blkio_test.go (100%) rename {cgroups => libcontainer/cgroups}/fs/cpu.go (100%) rename {cgroups => libcontainer/cgroups}/fs/cpu_test.go (100%) rename {cgroups => libcontainer/cgroups}/fs/cpuacct.go (98%) rename {cgroups => libcontainer/cgroups}/fs/cpuset.go (100%) rename {cgroups => libcontainer/cgroups}/fs/devices.go (100%) rename {cgroups => libcontainer/cgroups}/fs/freezer.go (95%) rename {cgroups => libcontainer/cgroups}/fs/memory.go (100%) rename {cgroups => libcontainer/cgroups}/fs/memory_test.go (100%) rename {cgroups => libcontainer/cgroups}/fs/perf_event.go (89%) rename {cgroups => libcontainer/cgroups}/fs/test_util.go (100%) rename {cgroups => libcontainer/cgroups}/fs/utils.go (100%) rename {cgroups => libcontainer/cgroups}/fs/utils_test.go (100%) rename {cgroups => libcontainer/cgroups}/systemd/apply_nosystemd.go (78%) rename {cgroups => libcontainer/cgroups}/systemd/apply_systemd.go (99%) rename {cgroups => libcontainer/cgroups}/utils.go (100%) diff --git a/cgroups/MAINTAINERS b/libcontainer/cgroups/MAINTAINERS similarity index 100% rename from cgroups/MAINTAINERS rename to libcontainer/cgroups/MAINTAINERS diff --git a/cgroups/cgroups.go b/libcontainer/cgroups/cgroups.go similarity index 100% rename from cgroups/cgroups.go rename to libcontainer/cgroups/cgroups.go diff --git a/cgroups/cgroups_test.go b/libcontainer/cgroups/cgroups_test.go similarity index 100% rename from cgroups/cgroups_test.go rename to libcontainer/cgroups/cgroups_test.go diff --git a/cgroups/fs/apply_raw.go b/libcontainer/cgroups/fs/apply_raw.go similarity index 98% rename from cgroups/fs/apply_raw.go rename to libcontainer/cgroups/fs/apply_raw.go index ee26bff..65aabcc 100644 --- a/cgroups/fs/apply_raw.go +++ b/libcontainer/cgroups/fs/apply_raw.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strconv" - "github.com/dotcloud/docker/pkg/cgroups" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" ) var ( diff --git a/cgroups/fs/blkio.go b/libcontainer/cgroups/fs/blkio.go similarity index 97% rename from cgroups/fs/blkio.go rename to libcontainer/cgroups/fs/blkio.go index 79e14fa..213d250 100644 --- a/cgroups/fs/blkio.go +++ b/libcontainer/cgroups/fs/blkio.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/dotcloud/docker/pkg/cgroups" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" ) type blkioGroup struct { diff --git a/cgroups/fs/blkio_test.go b/libcontainer/cgroups/fs/blkio_test.go similarity index 100% rename from cgroups/fs/blkio_test.go rename to libcontainer/cgroups/fs/blkio_test.go diff --git a/cgroups/fs/cpu.go b/libcontainer/cgroups/fs/cpu.go similarity index 100% rename from cgroups/fs/cpu.go rename to libcontainer/cgroups/fs/cpu.go diff --git a/cgroups/fs/cpu_test.go b/libcontainer/cgroups/fs/cpu_test.go similarity index 100% rename from cgroups/fs/cpu_test.go rename to libcontainer/cgroups/fs/cpu_test.go diff --git a/cgroups/fs/cpuacct.go b/libcontainer/cgroups/fs/cpuacct.go similarity index 98% rename from cgroups/fs/cpuacct.go rename to libcontainer/cgroups/fs/cpuacct.go index 892b5ab..3382440 100644 --- a/cgroups/fs/cpuacct.go +++ b/libcontainer/cgroups/fs/cpuacct.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/dotcloud/docker/pkg/cgroups" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" "github.com/dotcloud/docker/pkg/system" ) diff --git a/cgroups/fs/cpuset.go b/libcontainer/cgroups/fs/cpuset.go similarity index 100% rename from cgroups/fs/cpuset.go rename to libcontainer/cgroups/fs/cpuset.go diff --git a/cgroups/fs/devices.go b/libcontainer/cgroups/fs/devices.go similarity index 100% rename from cgroups/fs/devices.go rename to libcontainer/cgroups/fs/devices.go diff --git a/cgroups/fs/freezer.go b/libcontainer/cgroups/fs/freezer.go similarity index 95% rename from cgroups/fs/freezer.go rename to libcontainer/cgroups/fs/freezer.go index 70cfcdd..f3b1985 100644 --- a/cgroups/fs/freezer.go +++ b/libcontainer/cgroups/fs/freezer.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/dotcloud/docker/pkg/cgroups" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" ) type freezerGroup struct { diff --git a/cgroups/fs/memory.go b/libcontainer/cgroups/fs/memory.go similarity index 100% rename from cgroups/fs/memory.go rename to libcontainer/cgroups/fs/memory.go diff --git a/cgroups/fs/memory_test.go b/libcontainer/cgroups/fs/memory_test.go similarity index 100% rename from cgroups/fs/memory_test.go rename to libcontainer/cgroups/fs/memory_test.go diff --git a/cgroups/fs/perf_event.go b/libcontainer/cgroups/fs/perf_event.go similarity index 89% rename from cgroups/fs/perf_event.go rename to libcontainer/cgroups/fs/perf_event.go index 789b3e5..063cec4 100644 --- a/cgroups/fs/perf_event.go +++ b/libcontainer/cgroups/fs/perf_event.go @@ -1,7 +1,7 @@ package fs import ( - "github.com/dotcloud/docker/pkg/cgroups" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" ) type perfEventGroup struct { diff --git a/cgroups/fs/test_util.go b/libcontainer/cgroups/fs/test_util.go similarity index 100% rename from cgroups/fs/test_util.go rename to libcontainer/cgroups/fs/test_util.go diff --git a/cgroups/fs/utils.go b/libcontainer/cgroups/fs/utils.go similarity index 100% rename from cgroups/fs/utils.go rename to libcontainer/cgroups/fs/utils.go diff --git a/cgroups/fs/utils_test.go b/libcontainer/cgroups/fs/utils_test.go similarity index 100% rename from cgroups/fs/utils_test.go rename to libcontainer/cgroups/fs/utils_test.go diff --git a/cgroups/systemd/apply_nosystemd.go b/libcontainer/cgroups/systemd/apply_nosystemd.go similarity index 78% rename from cgroups/systemd/apply_nosystemd.go rename to libcontainer/cgroups/systemd/apply_nosystemd.go index 4faa749..302fab7 100644 --- a/cgroups/systemd/apply_nosystemd.go +++ b/libcontainer/cgroups/systemd/apply_nosystemd.go @@ -4,7 +4,8 @@ package systemd import ( "fmt" - "github.com/dotcloud/docker/pkg/cgroups" + + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" ) func UseSystemd() bool { diff --git a/cgroups/systemd/apply_systemd.go b/libcontainer/cgroups/systemd/apply_systemd.go similarity index 99% rename from cgroups/systemd/apply_systemd.go rename to libcontainer/cgroups/systemd/apply_systemd.go index c4b0937..52940f6 100644 --- a/cgroups/systemd/apply_systemd.go +++ b/libcontainer/cgroups/systemd/apply_systemd.go @@ -11,7 +11,7 @@ import ( "sync" systemd1 "github.com/coreos/go-systemd/dbus" - "github.com/dotcloud/docker/pkg/cgroups" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" "github.com/dotcloud/docker/pkg/systemd" "github.com/godbus/dbus" ) diff --git a/cgroups/utils.go b/libcontainer/cgroups/utils.go similarity index 100% rename from cgroups/utils.go rename to libcontainer/cgroups/utils.go diff --git a/libcontainer/container.go b/libcontainer/container.go index 5acdff3..7328f55 100644 --- a/libcontainer/container.go +++ b/libcontainer/container.go @@ -1,7 +1,7 @@ package libcontainer import ( - "github.com/dotcloud/docker/pkg/cgroups" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" ) // Context is a generic key value pair that allows diff --git a/libcontainer/nsinit/exec.go b/libcontainer/nsinit/exec.go index 5d0d772..03e0f4b 100644 --- a/libcontainer/nsinit/exec.go +++ b/libcontainer/nsinit/exec.go @@ -7,10 +7,10 @@ import ( "os/exec" "syscall" - "github.com/dotcloud/docker/pkg/cgroups" - "github.com/dotcloud/docker/pkg/cgroups/fs" - "github.com/dotcloud/docker/pkg/cgroups/systemd" "github.com/dotcloud/docker/pkg/libcontainer" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups/fs" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups/systemd" "github.com/dotcloud/docker/pkg/libcontainer/network" "github.com/dotcloud/docker/pkg/system" ) diff --git a/libcontainer/nsinit/unsupported.go b/libcontainer/nsinit/unsupported.go index 929b3db..51509f7 100644 --- a/libcontainer/nsinit/unsupported.go +++ b/libcontainer/nsinit/unsupported.go @@ -3,8 +3,8 @@ package nsinit import ( - "github.com/dotcloud/docker/pkg/cgroups" "github.com/dotcloud/docker/pkg/libcontainer" + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" ) func Exec(container *libcontainer.Container, term Terminal, rootfs, dataPath string, args []string, createCommand CreateCommand, startCallback func()) (int, error) { diff --git a/sysinfo/sysinfo.go b/sysinfo/sysinfo.go index 27af37b..bdc192b 100644 --- a/sysinfo/sysinfo.go +++ b/sysinfo/sysinfo.go @@ -1,11 +1,12 @@ package sysinfo import ( - "github.com/dotcloud/docker/pkg/cgroups" "io/ioutil" "log" "os" "path" + + "github.com/dotcloud/docker/pkg/libcontainer/cgroups" ) type SysInfo struct {