runc exec: fix setting process.ioPriority

Commit bfbd0305b added IOPriority field into both Config and Process,
but forgot to add a mechanism to actually use Process.IOPriority.
As a result, runc exec does not set Process.IOPriority ever.

Fix it, and a test case (which fails before the fix).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-01-07 19:48:58 -08:00
parent 73849e797f
commit b9114d91e2
7 changed files with 33 additions and 6 deletions
+2 -1
View File
@@ -81,6 +81,7 @@ type initConfig struct {
NoNewPrivileges bool `json:"no_new_privileges"`
ProcessLabel string `json:"process_label"`
Rlimits []configs.Rlimit `json:"rlimits"`
IOPriority *configs.IOPriority `json:"io_priority,omitempty"`
// Miscellaneous properties, filled in by [Container.newInitConfig]
// unless documented otherwise.
@@ -623,7 +624,7 @@ func setupScheduler(config *configs.Config) error {
return nil
}
func setupIOPriority(config *configs.Config) error {
func setupIOPriority(config *initConfig) error {
const ioprioWhoPgrp = 1
ioprio := config.IOPriority