Browse code

daemon: remove sysInitPath, lxc leftover

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

Antonio Murdaca authored on 2015/11/30 18:04:13
Showing 7 changed files
... ...
@@ -122,7 +122,6 @@ func (c *contStore) List() []*Container {
122 122
 type Daemon struct {
123 123
 	ID                        string
124 124
 	repository                string
125
-	sysInitPath               string
126 125
 	containers                *contStore
127 126
 	execCommands              *exec.Store
128 127
 	tagStore                  tag.Store
... ...
@@ -811,8 +810,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
811 811
 
812 812
 	d.containerGraphDB = graph
813 813
 
814
-	var sysInitPath string
815
-
816 814
 	sysInfo := sysinfo.New(false)
817 815
 	// Check if Devices cgroup is mounted, it is hard requirement for container security,
818 816
 	// on Linux/FreeBSD.
... ...
@@ -820,7 +817,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
820 820
 		return nil, fmt.Errorf("Devices cgroup isn't mounted")
821 821
 	}
822 822
 
823
-	ed, err := execdrivers.NewDriver(config.ExecOptions, config.ExecRoot, config.Root, sysInitPath, sysInfo)
823
+	ed, err := execdrivers.NewDriver(config.ExecOptions, config.ExecRoot, config.Root, sysInfo)
824 824
 	if err != nil {
825 825
 		return nil, err
826 826
 	}
... ...
@@ -835,7 +832,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
835 835
 	d.trustKey = trustKey
836 836
 	d.idIndex = truncindex.NewTruncIndex([]string{})
837 837
 	d.configStore = config
838
-	d.sysInitPath = sysInitPath
839 838
 	d.execDriver = ed
840 839
 	d.statsCollector = d.newStatsCollector(1 * time.Second)
841 840
 	d.defaultLogConfig = config.LogConfig
... ...
@@ -1275,10 +1271,6 @@ func (daemon *Daemon) config() *Config {
1275 1275
 	return daemon.configStore
1276 1276
 }
1277 1277
 
1278
-func (daemon *Daemon) systemInitPath() string {
1279
-	return daemon.sysInitPath
1280
-}
1281
-
1282 1278
 // GraphDriver returns the currently used driver for processing
1283 1279
 // container layers.
1284 1280
 func (daemon *Daemon) GraphDriver() graphdriver.Driver {
... ...
@@ -10,6 +10,6 @@ import (
10 10
 )
11 11
 
12 12
 // NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
13
-func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
13
+func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
14 14
 	return nil, fmt.Errorf("jail driver not yet supported on FreeBSD")
15 15
 }
... ...
@@ -11,6 +11,6 @@ import (
11 11
 )
12 12
 
13 13
 // NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
14
-func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
15
-	return native.NewDriver(path.Join(root, "execdriver", "native"), initPath, options)
14
+func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
15
+	return native.NewDriver(path.Join(root, "execdriver", "native"), options)
16 16
 }
... ...
@@ -9,6 +9,6 @@ import (
9 9
 )
10 10
 
11 11
 // NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
12
-func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
13
-	return windows.NewDriver(root, initPath, options)
12
+func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
13
+	return windows.NewDriver(root, options)
14 14
 }
... ...
@@ -38,7 +38,6 @@ const (
38 38
 // it implements execdriver.Driver.
39 39
 type Driver struct {
40 40
 	root             string
41
-	initPath         string
42 41
 	activeContainers map[string]libcontainer.Container
43 42
 	machineMemory    int64
44 43
 	factory          libcontainer.Factory
... ...
@@ -46,7 +45,7 @@ type Driver struct {
46 46
 }
47 47
 
48 48
 // NewDriver returns a new native driver, called from NewDriver of execdriver.
49
-func NewDriver(root, initPath string, options []string) (*Driver, error) {
49
+func NewDriver(root string, options []string) (*Driver, error) {
50 50
 	meminfo, err := sysinfo.ReadMemInfo()
51 51
 	if err != nil {
52 52
 		return nil, err
... ...
@@ -114,7 +113,6 @@ func NewDriver(root, initPath string, options []string) (*Driver, error) {
114 114
 
115 115
 	return &Driver{
116 116
 		root:             root,
117
-		initPath:         initPath,
118 117
 		activeContainers: make(map[string]libcontainer.Container),
119 118
 		machineMemory:    meminfo.MemTotal,
120 119
 		factory:          f,
... ...
@@ -42,7 +42,6 @@ type activeContainer struct {
42 42
 // it implements execdriver.Driver
43 43
 type Driver struct {
44 44
 	root             string
45
-	initPath         string
46 45
 	activeContainers map[string]*activeContainer
47 46
 	sync.Mutex
48 47
 }
... ...
@@ -53,7 +52,7 @@ func (d *Driver) Name() string {
53 53
 }
54 54
 
55 55
 // NewDriver returns a new windows driver, called from NewDriver of execdriver.
56
-func NewDriver(root, initPath string, options []string) (*Driver, error) {
56
+func NewDriver(root string, options []string) (*Driver, error) {
57 57
 
58 58
 	for _, option := range options {
59 59
 		key, val, err := parsers.ParseKeyValueOpt(option)
... ...
@@ -92,7 +91,6 @@ func NewDriver(root, initPath string, options []string) (*Driver, error) {
92 92
 
93 93
 	return &Driver{
94 94
 		root:             root,
95
-		initPath:         initPath,
96 95
 		activeContainers: make(map[string]*activeContainer),
97 96
 	}, nil
98 97
 }
... ...
@@ -52,11 +52,6 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
52 52
 	// that's more intuitive (the copied path is trivial to derive
53 53
 	// by hand given VERSION)
54 54
 	initPath := utils.DockerInitPath("")
55
-	if initPath == "" {
56
-		// if that fails, we'll just return the path from the daemon
57
-		initPath = daemon.systemInitPath()
58
-	}
59
-
60 55
 	sysInfo := sysinfo.New(true)
61 56
 
62 57
 	v := &types.Info{