From 9eea9ff36654d72105111b4f8a70188bffea07f5 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 1 Mar 2024 12:45:09 +0100 Subject: [PATCH] cgroup: make error clearer improve some cgroup errors including what controllers we are trying to enable. Signed-off-by: Giuseppe Scrivano --- src/libcrun/cgroup-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcrun/cgroup-utils.c b/src/libcrun/cgroup-utils.c index 92b923b7da..6c6ccb8b1e 100644 --- a/src/libcrun/cgroup-utils.c +++ b/src/libcrun/cgroup-utils.c @@ -778,7 +778,7 @@ write_controller_file (const char *path, int controllers_to_enable, libcrun_erro e = crun_error_get_errno (err); if (e != EPERM && e != EACCES && e != EBUSY && e != ENOENT && e != EOPNOTSUPP) - return ret; + return crun_error_wrap (err, "enable controllers `%s`", controllers); /* ENOENT can mean both that the file doesn't exist or the controller is not present. */ if (e == ENOENT) @@ -803,7 +803,7 @@ write_controller_file (const char *path, int controllers_to_enable, libcrun_erro { ret = maybe_make_cgroup_threaded (path, err); if (UNLIKELY (ret < 0)) - return ret; + return crun_error_wrap (err, "make cgroup threaded"); } /* It seems the kernel can return EBUSY when a process was moved to a sub-cgroup