From 05462305ec8b9ce5b414ede1e7e680b16d1a08ad Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Fri, 11 Feb 2022 18:20:59 +0800 Subject: [PATCH] util/log: add CONFIG_DISABLE_QEMU_LOG macro Using CONFIG_DISABLE_QEMU_LOG macro to control qemu_log function. Signed-off-by: Yan Wang --- util/log.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/log.c b/util/log.c index 2ee1500bee..ed3029fe5c 100644 --- a/util/log.c +++ b/util/log.c @@ -34,6 +34,12 @@ int qemu_loglevel; static int log_append = 0; static GArray *debug_regions; +#ifdef CONFIG_DISABLE_QEMU_LOG +int qemu_log(const char *fmt, ...) +{ + return 0; +} +#else /* Return the number of characters emitted. */ int qemu_log(const char *fmt, ...) { @@ -56,6 +62,7 @@ int qemu_log(const char *fmt, ...) rcu_read_unlock(); return ret; } +#endif static void __attribute__((__constructor__)) qemu_logfile_init(void) { -- 2.27.0