]> git.proxmox.com Git - qemu.git/commitdiff
qemu-log: Remove qemu_log_try_set_file() and its users
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 12 Feb 2013 16:13:27 +0000 (16:13 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 23 Feb 2013 09:42:14 +0000 (09:42 +0000)
Remove the function qemu_log_try_set_file() and its users (which
are all in TCG code generation functions for various targets).
This function was added to abstract out code which was originally
written as "if (!logfile) logfile = stderr;" in order that BUG:
case code which did an unguarded "fprintf(logfile, ...)" would
not crash if debug logging was not enabled. Since those direct
uses of logfile have also been abstracted away into qemu_log()
calls which check for a NULL logfile, there is no need for the
target-* files to mess with the user's chosen logging settings.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Michael Walle <michael@walle.cc>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
include/qemu/log.h
target-cris/translate.c
target-lm32/translate.c
target-microblaze/translate.c
target-openrisc/translate.c

index 5a46555112aa8c8ed98767dad3a93b795a31b6fe..452700329e59912e5e058b40e8acb30bbb8e7497 100644 (file)
@@ -126,14 +126,6 @@ static inline void qemu_log_set_file(FILE *f)
     qemu_logfile = f;
 }
 
-/* Set up a new log file, only if none is set */
-static inline void qemu_log_try_set_file(FILE *f)
-{
-    if (!qemu_logfile) {
-        qemu_logfile = f;
-    }
-}
-
 /* define log items */
 typedef struct QEMULogItem {
     int mask;
index 04a5379775b9bbe2ee4541c7c8f96e69f0f21b7e..2cf01a52e719c44c61b2947fb3d17982df536987 100644 (file)
@@ -3215,8 +3215,6 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb,
     int num_insns;
     int max_insns;
 
-    qemu_log_try_set_file(stderr);
-
     if (env->pregs[PR_VR] == 32) {
         dc->decoder = crisv32_decoder;
         dc->clear_locked_irq = 0;
index 6b873401747e1e75a4825785f27c48aa74f83684..ccaf838afa8635984b46733bbe9608be6a27896d 100644 (file)
@@ -1012,8 +1012,6 @@ static void gen_intermediate_code_internal(CPULM32State *env,
     int num_insns;
     int max_insns;
 
-    qemu_log_try_set_file(stderr);
-
     pc_start = tb->pc;
     dc->env = env;
     dc->tb = tb;
index 12ea820522166b7d0a3da80ab9de6f67189ddc8c..687b7d14335fc14c70f7ca4e9437891b3f0ce667 100644 (file)
@@ -1734,8 +1734,6 @@ gen_intermediate_code_internal(CPUMBState *env, TranslationBlock *tb,
     int num_insns;
     int max_insns;
 
-    qemu_log_try_set_file(stderr);
-
     pc_start = tb->pc;
     dc->env = env;
     dc->tb = tb;
index 1e1b30cdcb1ff7c2fc220546699c1c18f3fadff0..23e853e48882d47488ffbca28d4851d7ff63f245 100644 (file)
@@ -1670,8 +1670,6 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu,
     int num_insns;
     int max_insns;
 
-    qemu_log_try_set_file(stderr);
-
     pc_start = tb->pc;
     dc->tb = tb;