Skip to content

Conversation

@kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Oct 14, 2025

This is a backport of #4775 (and it's followups #4807 and #4825) to release-1.3 branch.


The support for per-devices weights and iops update was missing from runc,
and thus the example from the podman-update wasn't working.

To fix, introduce a function to either update or insert new weights and iops.

Add integration tests.

Fixes: https://issues.redhat.com/browse/RHEL-81042

See also: containers/podman#26308

@kolyshkin kolyshkin added the backport/1.3-pr A backport PR to release-1.3 label Oct 14, 2025
@kolyshkin kolyshkin added this to the 1.3.3 milestone Oct 14, 2025
@kolyshkin
Copy link
Contributor Author

For some reason this emits bogus linter-extra warnings (it didn't do it in #4775). Maybe we need to update golangci-lint in release-1.3 as well; let me try it.

@kolyshkin kolyshkin marked this pull request as draft October 14, 2025 01:11
@kolyshkin kolyshkin force-pushed the 1.3-update-resources branch from ddee53f to d3a23b5 Compare October 14, 2025 01:14
kolyshkin and others added 5 commits October 15, 2025 23:17
This support was missing from runc, and thus the example from the
podman-update wasn't working.

To fix, introduce a function to either update or insert new weights and iops.

Add integration tests.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 7696402)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
In case there's a duplicate in the device list, the latter entry
overrides the former one.

So, we need to modify the last entry, not the first one. To do that,
use slices.Backward.

Amend the test case to test the fix.

Reported-by: lifubang <lifubang@acmcoder.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 0b01dcc)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Apparently, having a minor of 0 does not always mean it's the
whole device (not a partition):

	 === /proc/partitions (using major: 259) ===
	 major minor  #blocks  name

	    8       16   78643200 sdb
	    8       17   77593583 sdb1
	    8       30       4096 sdb14
	    8       31     108544 sdb15
	  259        0     934912 sdb16
	    8        0   78643200 sda
	    8        1   78641152 sda1

Rewrite the test to not assume minor is 0, and use
lsblk -d to find out whole devices.

This fixes a test case which was added in commit 7696402.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 46dac58)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
If an error occurs during a test which sets up loopback devices, the
loopback device is not freed. Since most systems have very conservative
limits on the number of loopback devices, re-running a failing test
locally to debug it often ends up erroring out due to loopback device
exhaustion.

So let's just move the "losetup -d" to teardown, where it belongs.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
(cherry picked from commit ceef984)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
openSUSE has an unfortunate default udev setup which forcefully sets all
loop devices to use the "none" scheduler, even if you manually set it.
As this is a property of the host configuration (and udev is monitoring
from the host) we cannot really change this behaviour from inside our
test container.

So we should just skip the test in this (hopefully unusual) case.
Ideally tools running the test suite should disable this behaviour when
running our test suite.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
(cherry picked from commit e6b4b5a)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin force-pushed the 1.3-update-resources branch from d3a23b5 to 2e82e55 Compare October 16, 2025 06:17
@kolyshkin kolyshkin marked this pull request as ready for review October 16, 2025 06:17
@kolyshkin kolyshkin requested review from cyphar, lifubang and rata and removed request for lifubang October 16, 2025 06:17
@cyphar cyphar merged commit 8b7e3d7 into opencontainers:release-1.3 Oct 16, 2025
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.3-pr A backport PR to release-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants