daemon: remove sysInitPath, lxc leftover

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2015-11-30 10:04:13 +01:00
Родитель dd25d2c3db
Коммит 1b726b29b2
7 изменённых файлов: 8 добавлений и 25 удалений

Просмотреть файл

@ -122,7 +122,6 @@ func (c *contStore) List() []*Container {
type Daemon struct {
ID string
repository string
sysInitPath string
containers *contStore
execCommands *exec.Store
tagStore tag.Store
@ -811,8 +810,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
d.containerGraphDB = graph
var sysInitPath string
sysInfo := sysinfo.New(false)
// Check if Devices cgroup is mounted, it is hard requirement for container security,
// on Linux/FreeBSD.
@ -820,7 +817,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
return nil, fmt.Errorf("Devices cgroup isn't mounted")
}
ed, err := execdrivers.NewDriver(config.ExecOptions, config.ExecRoot, config.Root, sysInitPath, sysInfo)
ed, err := execdrivers.NewDriver(config.ExecOptions, config.ExecRoot, config.Root, sysInfo)
if err != nil {
return nil, err
}
@ -835,7 +832,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
d.trustKey = trustKey
d.idIndex = truncindex.NewTruncIndex([]string{})
d.configStore = config
d.sysInitPath = sysInitPath
d.execDriver = ed
d.statsCollector = d.newStatsCollector(1 * time.Second)
d.defaultLogConfig = config.LogConfig
@ -1275,10 +1271,6 @@ func (daemon *Daemon) config() *Config {
return daemon.configStore
}
func (daemon *Daemon) systemInitPath() string {
return daemon.sysInitPath
}
// GraphDriver returns the currently used driver for processing
// container layers.
func (daemon *Daemon) GraphDriver() graphdriver.Driver {

Просмотреть файл

@ -10,6 +10,6 @@ import (
)
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
return nil, fmt.Errorf("jail driver not yet supported on FreeBSD")
}

Просмотреть файл

@ -11,6 +11,6 @@ import (
)
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
return native.NewDriver(path.Join(root, "execdriver", "native"), initPath, options)
func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
return native.NewDriver(path.Join(root, "execdriver", "native"), options)
}

Просмотреть файл

@ -9,6 +9,6 @@ import (
)
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
return windows.NewDriver(root, initPath, options)
func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
return windows.NewDriver(root, options)
}

Просмотреть файл

@ -38,7 +38,6 @@ const (
// it implements execdriver.Driver.
type Driver struct {
root string
initPath string
activeContainers map[string]libcontainer.Container
machineMemory int64
factory libcontainer.Factory
@ -46,7 +45,7 @@ type Driver struct {
}
// NewDriver returns a new native driver, called from NewDriver of execdriver.
func NewDriver(root, initPath string, options []string) (*Driver, error) {
func NewDriver(root string, options []string) (*Driver, error) {
meminfo, err := sysinfo.ReadMemInfo()
if err != nil {
return nil, err
@ -114,7 +113,6 @@ func NewDriver(root, initPath string, options []string) (*Driver, error) {
return &Driver{
root: root,
initPath: initPath,
activeContainers: make(map[string]libcontainer.Container),
machineMemory: meminfo.MemTotal,
factory: f,

Просмотреть файл

@ -42,7 +42,6 @@ type activeContainer struct {
// it implements execdriver.Driver
type Driver struct {
root string
initPath string
activeContainers map[string]*activeContainer
sync.Mutex
}
@ -53,7 +52,7 @@ func (d *Driver) Name() string {
}
// NewDriver returns a new windows driver, called from NewDriver of execdriver.
func NewDriver(root, initPath string, options []string) (*Driver, error) {
func NewDriver(root string, options []string) (*Driver, error) {
for _, option := range options {
key, val, err := parsers.ParseKeyValueOpt(option)
@ -92,7 +91,6 @@ func NewDriver(root, initPath string, options []string) (*Driver, error) {
return &Driver{
root: root,
initPath: initPath,
activeContainers: make(map[string]*activeContainer),
}, nil
}

Просмотреть файл

@ -52,11 +52,6 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
// that's more intuitive (the copied path is trivial to derive
// by hand given VERSION)
initPath := utils.DockerInitPath("")
if initPath == "" {
// if that fails, we'll just return the path from the daemon
initPath = daemon.systemInitPath()
}
sysInfo := sysinfo.New(true)
v := &types.Info{