]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
commands: port lxc_cmd_get_cgroup_ctx() to new helpers
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 25 Feb 2021 09:19:15 +0000 (10:19 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 25 Feb 2021 11:03:26 +0000 (12:03 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/commands.c

index 2b0c39f6b18dc3ddb834258b8de1ac6304b3a552..ce52fb1a33e0ba50cc456ded8a1217292419925e 100644 (file)
@@ -702,17 +702,11 @@ int lxc_cmd_get_cgroup_ctx(const char *name, const char *lxcpath,
                           size_t size_ret_ctx, struct cgroup_ctx *ret_ctx)
 {
        bool stopped = false;
-       struct lxc_cmd_rr cmd = {
-               .req = {
-                       .cmd            = LXC_CMD_GET_CGROUP_CTX,
-                       .datalen        = size_ret_ctx,
-                       .data           = ret_ctx,
-               },
-               .rsp = {
-                       .ret = -ENOSYS,
-               },
-       };
        int ret;
+       struct lxc_cmd_rr cmd;
+
+       lxc_cmd_init(&cmd, LXC_CMD_GET_CGROUP_CTX);
+       lxc_cmd_data(&cmd, size_ret_ctx, ret_ctx);
 
        ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL);
        if (ret < 0)