Skip to content

Commit

Permalink
lxc/tools: set default log_priority to ERROR
Browse files Browse the repository at this point in the history
For some reason, we don't have default log_priority
set for many tools which leads to the situation when
tools can fail silently even if error occurs.

Fixes: lxc#4405
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
  • Loading branch information
mihalicyn committed Apr 2, 2024
1 parent 80e28c1 commit 816b897
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lxc/tools/lxc_autostart.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Options:\n\
.parser = my_parser,
.checker = NULL,
.timeout = 60,
.log_priority = "ERROR",
.log_file = "none",
};

static int list_contains_entry(char *str_ptr, struct lxc_list *p1) {
Expand Down
2 changes: 2 additions & 0 deletions src/lxc/tools/lxc_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ Options :\n\
.daemonize = 1,
.quiet = false,
.tmpfs = false,
.log_priority = "ERROR",
.log_file = "none",
};

static struct mnts *add_mnt(struct mnts **mnts, unsigned int *num,
Expand Down
2 changes: 2 additions & 0 deletions src/lxc/tools/lxc_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Options :\n\
.options = my_longopts,
.parser = my_parser,
.checker = NULL,
.log_priority = "ERROR",
.log_file = "none",
};

static void str_chomp(char *buf)
Expand Down
2 changes: 2 additions & 0 deletions src/lxc/tools/lxc_ls.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ Options :\n\
.options = my_longopts,
.parser = my_parser,
.ls_nesting = 0,
.log_priority = "ERROR",
.log_file = "none",
};

int __attribute__((weak, alias("lxc_ls_main"))) main(int argc, char *argv[]);
Expand Down
2 changes: 2 additions & 0 deletions src/lxc/tools/lxc_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Options :\n\
.parser = my_parser,
.checker = NULL,
.lxcpath_additional = -1,
.log_priority = "ERROR",
.log_file = "none",
};

static void close_fds(struct pollfd *fds, nfds_t nfds)
Expand Down
2 changes: 2 additions & 0 deletions src/lxc/tools/lxc_snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Options :\n\
.parser = my_parser,
.checker = NULL,
.task = SNAP,
.log_priority = "ERROR",
.log_file = "none",
};

static int do_snapshot(struct lxc_container *c, char *commentfile);
Expand Down
2 changes: 2 additions & 0 deletions src/lxc/tools/lxc_top.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Options :\n\
.parser = my_parser,
.checker = NULL,
.lxcpath_additional = -1,
.log_priority = "ERROR",
.log_file = "none",
};

static void stdin_tios_restore(void)
Expand Down

0 comments on commit 816b897

Please sign in to comment.