computing-offload/generic_vdpa/qemu/util-log-add-CONFIG_DISABLE_QEMU_LOG-macro.patch
jiangdongxu 79c4324644 add generic_vdpa basecode
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
2024-09-19 17:19:46 +08:00

42 lines
969 B
Diff

From 05462305ec8b9ce5b414ede1e7e680b16d1a08ad Mon Sep 17 00:00:00 2001
From: Yan Wang <wangyan122@huawei.com>
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 <wangyan122@huawei.com>
---
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