2014-01-15 17:36:13 -05:00
|
|
|
package sysinfo
|
|
|
|
|
2015-03-26 23:05:07 -04:00
|
|
|
// SysInfo stores information about which features a kernel supports.
|
2015-05-14 12:05:14 -04:00
|
|
|
// TODO Windows: Factor out platform specific capabilities.
|
2014-01-15 17:36:13 -05:00
|
|
|
type SysInfo struct {
|
2015-07-22 06:31:34 -04:00
|
|
|
// Whether the kernel supports AppArmor or not
|
2015-06-16 22:36:20 -04:00
|
|
|
AppArmor bool
|
2015-07-22 06:31:34 -04:00
|
|
|
|
2015-08-06 18:29:10 -04:00
|
|
|
cgroupMemInfo
|
|
|
|
cgroupCPUInfo
|
|
|
|
cgroupBlkioInfo
|
|
|
|
cgroupCpusetInfo
|
2015-07-22 06:31:34 -04:00
|
|
|
|
|
|
|
// Whether IPv4 forwarding is supported or not, if this was disabled, networking will not work
|
|
|
|
IPv4ForwardingDisabled bool
|
|
|
|
|
|
|
|
// Whether bridge-nf-call-iptables is supported or not
|
|
|
|
BridgeNfCallIptablesDisabled bool
|
|
|
|
|
|
|
|
// Whether bridge-nf-call-ip6tables is supported or not
|
|
|
|
BridgeNfCallIP6tablesDisabled bool
|
|
|
|
|
|
|
|
// Whether the cgroup has the mountpoint of "devices" or not
|
|
|
|
CgroupDevicesEnabled bool
|
2015-06-16 22:36:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type cgroupMemInfo struct {
|
2015-07-22 06:31:34 -04:00
|
|
|
// Whether memory limit is supported or not
|
|
|
|
MemoryLimit bool
|
|
|
|
|
|
|
|
// Whether swap limit is supported or not
|
|
|
|
SwapLimit bool
|
|
|
|
|
|
|
|
// Whether OOM killer disalbe is supported or not
|
|
|
|
OomKillDisable bool
|
|
|
|
|
|
|
|
// Whether memory swappiness is supported or not
|
2015-07-12 03:46:33 -04:00
|
|
|
MemorySwappiness bool
|
2015-08-19 11:56:55 -04:00
|
|
|
|
|
|
|
// Whether kernel memory limit is supported or not
|
|
|
|
KernelMemory bool
|
2015-06-16 22:36:20 -04:00
|
|
|
}
|
|
|
|
|
2015-07-22 06:31:34 -04:00
|
|
|
type cgroupCPUInfo struct {
|
2015-08-05 10:35:18 -04:00
|
|
|
// Whether CPU shares is supported or not
|
|
|
|
CPUShares bool
|
|
|
|
|
2015-07-22 06:31:34 -04:00
|
|
|
// Whether CPU CFS(Completely Fair Scheduler) period is supported or not
|
|
|
|
CPUCfsPeriod bool
|
|
|
|
|
|
|
|
// Whether CPU CFS(Completely Fair Scheduler) quota is supported or not
|
|
|
|
CPUCfsQuota bool
|
2014-01-15 17:36:13 -05:00
|
|
|
}
|
2015-08-05 10:35:18 -04:00
|
|
|
|
|
|
|
type cgroupBlkioInfo struct {
|
|
|
|
// Whether Block IO weight is supported or not
|
|
|
|
BlkioWeight bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type cgroupCpusetInfo struct {
|
|
|
|
// Whether Cpuset is supported or not
|
|
|
|
Cpuset bool
|
|
|
|
}
|