Skip to content

Commit

Permalink
commands: port lxc_cmd_get_config_item() to new helpers
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent 9e6dda9 commit e003f52
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/lxc/commands.c
Expand Up @@ -922,13 +922,14 @@ char *lxc_cmd_get_config_item(const char *name, const char *item,
const char *lxcpath)
{
bool stopped = false;
struct lxc_cmd_rr cmd = {
.req = { .cmd = LXC_CMD_GET_CONFIG_ITEM,
.data = item,
.datalen = strlen(item) + 1,
},
};
int ret;
struct lxc_cmd_rr cmd;

if (is_empty_string(item))
return NULL;

lxc_cmd_init(&cmd, LXC_CMD_GET_CONFIG_ITEM);
lxc_cmd_data(&cmd, strlen(item) + 1, item);

ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL);
if (ret < 0)
Expand Down

0 comments on commit e003f52

Please sign in to comment.