From d307dbcab74aef3680ba99d7f836f2bc0b4bc81e Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 30 May 2022 22:30:13 +0100 Subject: [PATCH] allow all LOG_* levels (#691) While libvfio-user doesn't use them all, at least SPDK was expecting to be able to set LOG_NOTICE level, and silently failing. There's no reason we can't support any valid syslog level. Signed-off-by: John Levon Reviewed-by: Swapnil Ingle --- lib/libvfio-user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index 566ece08..47e3572f 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -1755,8 +1755,7 @@ vfu_get_poll_fd(vfu_ctx_t *vfu_ctx) EXPORT int vfu_setup_log(vfu_ctx_t *vfu_ctx, vfu_log_fn_t *log, int log_level) { - - if (log_level != LOG_ERR && log_level != LOG_INFO && log_level != LOG_DEBUG) { + if (log_level < LOG_EMERG || log_level > LOG_DEBUG) { return ERROR_INT(EINVAL); }