mirror of
https://github.com/containers/podman.git
synced 2025-10-12 16:56:32 +08:00
inspect: Ignore character devices for IO limits
Cgroup block I/O limits cannot be applied to character devices. Ignore character devices in the inspect output. Update the API tests to use the null block device `/dev/nullb0` (if available) instead of `/dev/zero` for testing I/O limits. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -653,7 +653,7 @@ func (c *Container) GetDevices(priv bool, ctrSpec spec.Spec, deviceNodes map[str
|
||||
for _, dev := range ctrSpec.Linux.Devices {
|
||||
key := fmt.Sprintf("%d:%d", dev.Major, dev.Minor)
|
||||
if deviceNodes == nil {
|
||||
nodes, err := util.FindDeviceNodes()
|
||||
nodes, err := util.FindDeviceNodes(false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -678,7 +678,7 @@ func blkioDeviceThrottle(deviceNodes map[string]string, devs []spec.LinuxThrottl
|
||||
for _, dev := range devs {
|
||||
key := fmt.Sprintf("%d:%d", dev.Major, dev.Minor)
|
||||
if deviceNodes == nil {
|
||||
nodes, err := util.FindDeviceNodes()
|
||||
nodes, err := util.FindDeviceNodes(true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user