Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Ma Shimiao authored on 2015/12/15 10:50:16... | ... |
@@ -46,17 +46,17 @@ const ( |
46 | 46 |
|
47 | 47 |
func getBlkioWeightDevices(config *runconfig.HostConfig) ([]*blkiodev.WeightDevice, error) { |
48 | 48 |
var stat syscall.Stat_t |
49 |
- var BlkioWeightDevices []*blkiodev.WeightDevice |
|
49 |
+ var blkioWeightDevices []*blkiodev.WeightDevice |
|
50 | 50 |
|
51 | 51 |
for _, weightDevice := range config.BlkioWeightDevice { |
52 | 52 |
if err := syscall.Stat(weightDevice.Path, &stat); err != nil { |
53 | 53 |
return nil, err |
54 | 54 |
} |
55 |
- WeightDevice := blkiodev.NewWeightDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), weightDevice.Weight, 0) |
|
56 |
- BlkioWeightDevices = append(BlkioWeightDevices, WeightDevice) |
|
55 |
+ weightDevice := blkiodev.NewWeightDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), weightDevice.Weight, 0) |
|
56 |
+ blkioWeightDevices = append(blkioWeightDevices, weightDevice) |
|
57 | 57 |
} |
58 | 58 |
|
59 |
- return BlkioWeightDevices, nil |
|
59 |
+ return blkioWeightDevices, nil |
|
60 | 60 |
} |
61 | 61 |
|
62 | 62 |
func parseSecurityOpt(container *container.Container, config *runconfig.HostConfig) error { |
... | ... |
@@ -87,33 +87,33 @@ func parseSecurityOpt(container *container.Container, config *runconfig.HostConf |
87 | 87 |
} |
88 | 88 |
|
89 | 89 |
func getBlkioReadBpsDevices(config *runconfig.HostConfig) ([]*blkiodev.ThrottleDevice, error) { |
90 |
- var BlkioReadBpsDevice []*blkiodev.ThrottleDevice |
|
90 |
+ var blkioReadBpsDevice []*blkiodev.ThrottleDevice |
|
91 | 91 |
var stat syscall.Stat_t |
92 | 92 |
|
93 | 93 |
for _, bpsDevice := range config.BlkioDeviceReadBps { |
94 | 94 |
if err := syscall.Stat(bpsDevice.Path, &stat); err != nil { |
95 | 95 |
return nil, err |
96 | 96 |
} |
97 |
- ReadBpsDevice := blkiodev.NewThrottleDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), bpsDevice.Rate) |
|
98 |
- BlkioReadBpsDevice = append(BlkioReadBpsDevice, ReadBpsDevice) |
|
97 |
+ readBpsDevice := blkiodev.NewThrottleDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), bpsDevice.Rate) |
|
98 |
+ blkioReadBpsDevice = append(blkioReadBpsDevice, readBpsDevice) |
|
99 | 99 |
} |
100 | 100 |
|
101 |
- return BlkioReadBpsDevice, nil |
|
101 |
+ return blkioReadBpsDevice, nil |
|
102 | 102 |
} |
103 | 103 |
|
104 | 104 |
func getBlkioWriteBpsDevices(config *runconfig.HostConfig) ([]*blkiodev.ThrottleDevice, error) { |
105 |
- var BlkioWriteBpsDevice []*blkiodev.ThrottleDevice |
|
105 |
+ var blkioWriteBpsDevice []*blkiodev.ThrottleDevice |
|
106 | 106 |
var stat syscall.Stat_t |
107 | 107 |
|
108 | 108 |
for _, bpsDevice := range config.BlkioDeviceWriteBps { |
109 | 109 |
if err := syscall.Stat(bpsDevice.Path, &stat); err != nil { |
110 | 110 |
return nil, err |
111 | 111 |
} |
112 |
- WriteBpsDevice := blkiodev.NewThrottleDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), bpsDevice.Rate) |
|
113 |
- BlkioWriteBpsDevice = append(BlkioWriteBpsDevice, WriteBpsDevice) |
|
112 |
+ writeBpsDevice := blkiodev.NewThrottleDevice(int64(stat.Rdev/256), int64(stat.Rdev%256), bpsDevice.Rate) |
|
113 |
+ blkioWriteBpsDevice = append(blkioWriteBpsDevice, writeBpsDevice) |
|
114 | 114 |
} |
115 | 115 |
|
116 |
- return BlkioWriteBpsDevice, nil |
|
116 |
+ return blkioWriteBpsDevice, nil |
|
117 | 117 |
} |
118 | 118 |
|
119 | 119 |
func checkKernelVersion(k, major, minor int) bool { |