[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/29] tools/virtiofsd: add G_GNUC_PRINTF for logging functions
From: |
Paolo Bonzini |
Subject: |
[PULL 11/29] tools/virtiofsd: add G_GNUC_PRINTF for logging functions |
Date: |
Tue, 10 Jan 2023 17:02:15 +0100 |
From: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221219130205.687815-4-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tools/virtiofsd/fuse_log.c | 1 +
tools/virtiofsd/fuse_log.h | 6 ++++--
tools/virtiofsd/passthrough_ll.c | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c
index 745d88cd2a49..2de3f48ee7ea 100644
--- a/tools/virtiofsd/fuse_log.c
+++ b/tools/virtiofsd/fuse_log.c
@@ -12,6 +12,7 @@
#include "fuse_log.h"
+G_GNUC_PRINTF(2, 0)
static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
const char *fmt, va_list ap)
{
diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h
index 8d7091bd4d0b..e5c2967ab95a 100644
--- a/tools/virtiofsd/fuse_log.h
+++ b/tools/virtiofsd/fuse_log.h
@@ -45,7 +45,8 @@ enum fuse_log_level {
* @param ap format string arguments
*/
typedef void (*fuse_log_func_t)(enum fuse_log_level level, const char *fmt,
- va_list ap);
+ va_list ap)
+ G_GNUC_PRINTF(2, 0);
/**
* Install a custom log handler function.
@@ -68,6 +69,7 @@ void fuse_set_log_func(fuse_log_func_t func);
* @param level severity level (FUSE_LOG_ERR, FUSE_LOG_DEBUG, etc)
* @param fmt sprintf-style format string including newline
*/
-void fuse_log(enum fuse_log_level level, const char *fmt, ...);
+void fuse_log(enum fuse_log_level level, const char *fmt, ...)
+ G_GNUC_PRINTF(2, 3);
#endif /* FUSE_LOG_H_ */
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 20f0f41f99a5..40ea2ed27fef 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -4182,6 +4182,7 @@ static void setup_nofile_rlimit(unsigned long
rlimit_nofile)
}
}
+G_GNUC_PRINTF(2, 0)
static void log_func(enum fuse_log_level level, const char *fmt, va_list ap)
{
g_autofree char *localfmt = NULL;
--
2.38.1
- [PULL 00/29] Misc patches for 2023-01-10, Paolo Bonzini, 2023/01/10
- [PULL 01/29] configure: fix GLIB_VERSION for cross-compilation, Paolo Bonzini, 2023/01/10
- [PULL 04/29] KVM: keep track of running ioctls, Paolo Bonzini, 2023/01/10
- [PULL 05/29] kvm: Atomic memslot updates, Paolo Bonzini, 2023/01/10
- [PULL 03/29] accel: introduce accelerator blocker API, Paolo Bonzini, 2023/01/10
- [PULL 02/29] i386: Emit correct error code for 64-bit IDT entry, Paolo Bonzini, 2023/01/10
- [PULL 10/29] hw/xen: use G_GNUC_PRINTF/SCANF for various functions, Paolo Bonzini, 2023/01/10
- [PULL 14/29] enforce use of G_GNUC_PRINTF attributes, Paolo Bonzini, 2023/01/10
- [PULL 07/29] chardev: clean up chardev-parallel.c, Paolo Bonzini, 2023/01/10
- [PULL 15/29] hw/display: avoid creating empty loadable modules, Paolo Bonzini, 2023/01/10
- [PULL 11/29] tools/virtiofsd: add G_GNUC_PRINTF for logging functions,
Paolo Bonzini <=
- [PULL 17/29] libvhost-user: Replace typeof with __typeof__, Paolo Bonzini, 2023/01/10
- [PULL 24/29] libvduse: Fix assignment in vring_set_avail_event, Paolo Bonzini, 2023/01/10
- [PULL 22/29] libvduse: Provide _GNU_SOURCE when compiling outside of QEMU, Paolo Bonzini, 2023/01/10
- [PULL 21/29] libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant, Paolo Bonzini, 2023/01/10
- [PULL 06/29] target/i386: Remove compilation errors when -Werror=maybe-uninitialized, Paolo Bonzini, 2023/01/10
- [PULL 09/29] disas: add G_GNUC_PRINTF to gstring_printf, Paolo Bonzini, 2023/01/10
- [PULL 12/29] util/error: add G_GNUC_PRINTF for various functions, Paolo Bonzini, 2023/01/10