Skip to content

validation: set the blkio rules on a block device that exists - #821

Open
dangowrt wants to merge 1 commit into
opencontainers:masterfrom
dangowrt:blkio-real-device
Open

dangowrt wants to merge 1 commit into
opencontainers:masterfrom
dangowrt:blkio-real-device

Conversation

@dangowrt

Copy link
Copy Markdown
Contributor

linux_cgroups_blkio and linux_cgroups_relative_blkio name block device 8:0 and assume /dev/sda exists. On a host whose disks are virtio, NVMe or MMC there is no 8:0, the kernel rejects the io.max entry for it, and a runtime that reports the failed write cannot create the container, so both tests fail without looking at the runtime's blkio handling.

This adds util.GetBlockDevice(), which takes the device number of a whole disk from /sys/block (only whole disks are listed there), preferring one backed by hardware over loop and RAM disks, and uses it in both tests.

Both blkio tests name device 8:0 and assume that /dev/sda exists. On a
host whose disks are virtio, NVMe or MMC there is no 8:0, the kernel
refuses an io.max entry for it, and a runtime that reports the failed
write cannot create the container, so the tests fail without having
looked at the runtime's blkio handling. Take the device number of a
whole disk from /sys/block instead, preferring one backed by hardware.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
@dangowrt
dangowrt marked this pull request as ready for review October 20, 2026 19:06
@dangowrt
dangowrt requested a review from a team as a code owner October 20, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant