[CRIU] [PATCH 1/8] compel/log: Use enum as parameter for std_log_set_loglevel()

Dmitry Safonov dima at arista.com
Fri Jul 26 01:01:07 MSK 2019


Doesn't change uapi, but makes it a bit more friendly and documented
which loglevel means what for foreign user.

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 compel/plugins/include/uapi/std/log.h | 4 +++-
 compel/plugins/std/log.c              | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/compel/plugins/include/uapi/std/log.h b/compel/plugins/include/uapi/std/log.h
index fbd1803bb247..7b27b12508c1 100644
--- a/compel/plugins/include/uapi/std/log.h
+++ b/compel/plugins/include/uapi/std/log.h
@@ -1,10 +1,12 @@
 #ifndef COMPEL_PLUGIN_STD_LOG_H__
 #define COMPEL_PLUGIN_STD_LOG_H__
 
+#include "compel/loglevels.h"
+
 #define STD_LOG_SIMPLE_CHUNK	256
 
 extern void std_log_set_fd(int fd);
-extern void std_log_set_loglevel(unsigned int level);
+extern void std_log_set_loglevel(enum __compel_log_levels level);
 extern void std_log_set_start(struct timeval *tv);
 extern int std_vprint_num(char *buf, int blen, int num, char **ps);
 extern void std_sprintf(char output[STD_LOG_SIMPLE_CHUNK], const char *format, ...)
diff --git a/compel/plugins/std/log.c b/compel/plugins/std/log.c
index 403ea46f78b0..06b9894aea38 100644
--- a/compel/plugins/std/log.c
+++ b/compel/plugins/std/log.c
@@ -120,7 +120,7 @@ void std_log_set_fd(int fd)
 	logfd = fd;
 }
 
-void std_log_set_loglevel(unsigned int level)
+void std_log_set_loglevel(enum __compel_log_levels level)
 {
 	cur_loglevel = level;
 }
-- 
2.22.0



More information about the CRIU mailing list