From 80da60e12d12e7c4b40cf80fbdd5260fa0c12785 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 30 May 2025 15:08:21 -0700 Subject: [PATCH] runc update: support per-device weight and iops 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 (cherry picked from commit 7696402dac66a1468f6269c1afc48c5d6b6e9115) Signed-off-by: Kir Kolyshkin --- tests/integration/cgroups.bats | 35 +++++++++++++++++---- tests/integration/helpers.bash | 16 ++++++++++ tests/integration/update.bats | 54 ++++++++++++++++++++++++++++++++ update.go | 57 ++++++++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+), 6 deletions(-) diff --git a/tests/integration/cgroups.bats b/tests/integration/cgroups.bats index 29cd09782..57aa898a2 100644 --- a/tests/integration/cgroups.bats +++ b/tests/integration/cgroups.bats @@ -174,17 +174,40 @@ function setup() { runc run -d --console-socket "$CONSOLE_SOCKET" test_dev_weight [ "$status" -eq 0 ] - # The loop device itself is no longer needed. - losetup -d "$dev" - if [ -v CGROUP_V2 ]; then file="io.bfq.weight" else file="blkio.bfq.weight_device" fi - weights=$(get_cgroup_value $file) - [[ "$weights" == *"default 333"* ]] - [[ "$weights" == *"$major:$minor 444"* ]] + weights1=$(get_cgroup_value $file) + + # Check that runc update works. + runc update -r - test_dev_weight <