Class: OsCtld::Devices::V2::ContainerConfigurator

Inherits:
Configurator show all
Defined in:
lib/osctld/devices/v2/container_configurator.rb

Instance Attribute Summary

Attributes inherited from Configurator

#prog_name

Attributes inherited from Configurator

#owner

Instance Method Summary collapse

Methods inherited from Configurator

#attach_prog, #get_prog

Methods inherited from Configurator

#add_device, #apply_changes, #dup, #initialize, #remove_device

Constructor Details

This class inherits a constructor from OsCtld::Devices::Configurator

Instance Method Details

#abs_cgroup_pathObject (protected)



24
25
26
# File 'lib/osctld/devices/v2/container_configurator.rb', line 24

def abs_cgroup_path
  owner.abs_apply_cgroup_path('devices')
end

#cgroup_pathObject (protected)



20
21
22
# File 'lib/osctld/devices/v2/container_configurator.rb', line 20

def cgroup_path
  owner.base_cgroup_path
end

#init(devices) ⇒ Object



5
6
7
8
9
# File 'lib/osctld/devices/v2/container_configurator.rb', line 5

def init(devices)
  # Container cgroups need not be initialized, they'll be created & configured
  # on-demand when the container is starting from the ct_pre_start hook.
  get_prog(devices)
end

#reconfigure(devices) ⇒ Object



11
12
13
14
15
16
# File 'lib/osctld/devices/v2/container_configurator.rb', line 11

def reconfigure(devices)
  # Containers that haven't been started yet do not have their cgroup created
  return unless CGroup.exist?(abs_cgroup_path)

  attach_prog(devices)
end