43 lines
959 B
Diff
43 lines
959 B
Diff
|
|
From 28763d8df34c20cab60baec8f4f5615cbea8c0df 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>
|
||
|
|
Signed-off-by: Adttil <yangtao286@huawei.com>
|
||
|
|
---
|
||
|
|
util/log.c | 7 +++++++
|
||
|
|
1 file changed, 7 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/util/log.c b/util/log.c
|
||
|
|
index d36c98da0b..78b6cf225f 100644
|
||
|
|
--- a/util/log.c
|
||
|
|
+++ b/util/log.c
|
||
|
|
@@ -143,6 +143,12 @@ void qemu_log_unlock(FILE *logfile)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
+#ifdef CONFIG_DISABLE_QEMU_LOG
|
||
|
|
+void qemu_log(const char *fmt, ...)
|
||
|
|
+{
|
||
|
|
+ return;
|
||
|
|
+}
|
||
|
|
+#else
|
||
|
|
void qemu_log(const char *fmt, ...)
|
||
|
|
{
|
||
|
|
FILE *f = qemu_log_trylock();
|
||
|
|
@@ -155,6 +161,7 @@ void qemu_log(const char *fmt, ...)
|
||
|
|
qemu_log_unlock(f);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
+#endif
|
||
|
|
|
||
|
|
static void __attribute__((__constructor__)) startup(void)
|
||
|
|
{
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|