summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson2022-04-17 20:29:46 +0200
committerRichard Henderson2022-04-20 19:51:11 +0200
commitc59fe6e536adfb2d6f3410f19d592496933f68de (patch)
tree100fa4637d6a8ae317e0bc8ca6cb1cd14632c1cf /include
parentos-posix: Use qemu_log_enabled (diff)
downloadqemu-c59fe6e536adfb2d6f3410f19d592496933f68de.tar.gz
qemu-c59fe6e536adfb2d6f3410f19d592496933f68de.tar.xz
qemu-c59fe6e536adfb2d6f3410f19d592496933f68de.zip
util/log: Move qemu_log_lock, qemu_log_unlock out of line
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220417183019.755276-7-richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/log.h28
1 files changed, 3 insertions, 25 deletions
diff --git a/include/qemu/log.h b/include/qemu/log.h
index 0b892f5e90..6a6b1efce5 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -65,32 +65,10 @@ static inline bool qemu_log_separate(void)
/* LOG_STRACE is used for user-mode strace logging. */
#define LOG_STRACE (1 << 19)
-/* Lock output for a series of related logs. Since this is not needed
- * for a single qemu_log / qemu_log_mask / qemu_log_mask_and_addr, we
- * assume that qemu_loglevel_mask has already been tested, and that
- * qemu_loglevel is never set when qemu_logfile is unset.
- */
+/* Lock/unlock output. */
-static inline FILE *qemu_log_lock(void)
-{
- QemuLogFile *logfile;
- rcu_read_lock();
- logfile = qatomic_rcu_read(&qemu_logfile);
- if (logfile) {
- qemu_flockfile(logfile->fd);
- return logfile->fd;
- } else {
- return NULL;
- }
-}
-
-static inline void qemu_log_unlock(FILE *fd)
-{
- if (fd) {
- qemu_funlockfile(fd);
- }
- rcu_read_unlock();
-}
+FILE *qemu_log_lock(void);
+void qemu_log_unlock(FILE *fd);
/* Logging functions: */