[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/39] util/log: Drop return value from qemu_log
From: |
Richard Henderson |
Subject: |
[PULL 17/39] util/log: Drop return value from qemu_log |
Date: |
Wed, 20 Apr 2022 11:05:56 -0700 |
The only user of this feature, tcg_dump_ops, has been
converted to use fprintf directly.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220417183019.755276-18-richard.henderson@linaro.org>
---
include/qemu/log-for-trace.h | 2 +-
util/log.c | 13 ++-----------
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/include/qemu/log-for-trace.h b/include/qemu/log-for-trace.h
index 5e41517227..d47c9cd446 100644
--- a/include/qemu/log-for-trace.h
+++ b/include/qemu/log-for-trace.h
@@ -30,6 +30,6 @@ static inline bool qemu_loglevel_mask(int mask)
}
/* main logging function */
-int G_GNUC_PRINTF(1, 2) qemu_log(const char *fmt, ...);
+void G_GNUC_PRINTF(1, 2) qemu_log(const char *fmt, ...);
#endif
diff --git a/util/log.c b/util/log.c
index 090bc3bc39..2bd4dfba1b 100644
--- a/util/log.c
+++ b/util/log.c
@@ -59,26 +59,17 @@ void qemu_log_unlock(FILE *fd)
}
}
-/* Return the number of characters emitted. */
-int qemu_log(const char *fmt, ...)
+void qemu_log(const char *fmt, ...)
{
FILE *f = qemu_log_trylock();
- int ret = 0;
-
if (f) {
va_list ap;
va_start(ap, fmt);
- ret = vfprintf(f, fmt, ap);
+ vfprintf(f, fmt, ap);
va_end(ap);
qemu_log_unlock(f);
-
- /* Don't pass back error results. */
- if (ret < 0) {
- ret = 0;
- }
}
- return ret;
}
static void __attribute__((__constructor__)) qemu_logfile_init(void)
--
2.34.1
- [PULL 12/39] exec/translator: Pass the locked filepointer to disas_log hook, (continued)
- [PULL 12/39] exec/translator: Pass the locked filepointer to disas_log hook, Richard Henderson, 2022/04/20
- [PULL 06/39] util/log: Move qemu_log_lock, qemu_log_unlock out of line, Richard Henderson, 2022/04/20
- [PULL 10/39] util/log: Remove qemu_log_vprintf, Richard Henderson, 2022/04/20
- [PULL 11/39] tcg: Pass the locked filepointer to tcg_dump_ops, Richard Henderson, 2022/04/20
- [PULL 14/39] accel/tcg: Use cpu_dump_state between qemu_log_trylock/unlock, Richard Henderson, 2022/04/20
- [PULL 15/39] target/nios2: Remove log_cpu_state from reset, Richard Henderson, 2022/04/20
- [PULL 16/39] util/log: Use qemu_log_trylock/unlock in qemu_log, Richard Henderson, 2022/04/20
- [PULL 19/39] util/log: Remove qemu_log_flush, Richard Henderson, 2022/04/20
- [PULL 18/39] util/log: Mark qemu_log_trylock as G_GNUC_WARN_UNUSED_RESULT, Richard Henderson, 2022/04/20
- [PULL 20/39] util/log: Drop call to setvbuf, Richard Henderson, 2022/04/20
- [PULL 17/39] util/log: Drop return value from qemu_log,
Richard Henderson <=
- [PULL 24/39] include/exec/log: Do not reference QemuLogFile directly, Richard Henderson, 2022/04/20
- [PULL 23/39] tests/unit: Do not reference QemuLogFile directly, Richard Henderson, 2022/04/20
- [PULL 21/39] bsd-user: Expand log_page_dump inline, Richard Henderson, 2022/04/20
- [PULL 25/39] include/qemu/log: Move entire implementation out-of-line, Richard Henderson, 2022/04/20
- [PULL 22/39] linux-user: Expand log_page_dump inline, Richard Henderson, 2022/04/20
- [PULL 27/39] util/log: Introduce qemu_set_log_filename_flags, Richard Henderson, 2022/04/20
- [PULL 26/39] sysemu/os-win32: Test for and use _lock_file/_unlock_file, Richard Henderson, 2022/04/20
- [PULL 29/39] linux-user: Use qemu_set_log_filename_flags, Richard Henderson, 2022/04/20
- [PULL 30/39] softmmu: Use qemu_set_log_filename_flags, Richard Henderson, 2022/04/20
- [PULL 31/39] util/log: Remove qemu_log_close, Richard Henderson, 2022/04/20