]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
commands: port lxc_cmd_stop() to new helpers
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 25 Feb 2021 09:20:55 +0000 (10:20 +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 762db6381b052f87f7f06626b43175d5442a8c26..6e91118751b64a11587fdb6e38085935f06d9cdb 100644 (file)
@@ -1029,12 +1029,10 @@ static int lxc_cmd_get_state_callback(int fd, struct lxc_cmd_req *req,
 int lxc_cmd_stop(const char *name, const char *lxcpath)
 {
        bool stopped = false;
-       struct lxc_cmd_rr cmd = {
-               .req = {
-                       .cmd = LXC_CMD_STOP,
-               },
-       };
        int ret;
+       struct lxc_cmd_rr cmd;
+
+       lxc_cmd_init(&cmd, LXC_CMD_STOP);
 
        ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL);
        if (ret < 0) {