From fc59d2d870caddf5cd9c85836ee4a8c59ffe7617 Mon Sep 17 00:00:00 2001 From: Robert Foley Date: Mon, 18 Nov 2019 16:15:26 -0500 Subject: qemu_log_lock/unlock now preserves the qemu_logfile handle. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qemu_log_lock() now returns a handle and qemu_log_unlock() receives a handle to unlock. This allows for changing the handle during logging and ensures the lock() and unlock() are for the same file. Also in target/tilegx/translate.c removed the qemu_log_lock()/unlock() calls (and the log("\n")), since the translator can longjmp out of the loop if it attempts to translate an instruction in an inaccessible page. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20191118211528.3221-5-robert.foley@linaro.org> --- exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index a34c348184..edafdebeec 100644 --- a/exec.c +++ b/exec.c @@ -1225,13 +1225,13 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) fprintf(stderr, "\n"); cpu_dump_state(cpu, stderr, CPU_DUMP_FPU | CPU_DUMP_CCOP); if (qemu_log_separate()) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("qemu: fatal: "); qemu_log_vprintf(fmt, ap2); qemu_log("\n"); log_cpu_state(cpu, CPU_DUMP_FPU | CPU_DUMP_CCOP); qemu_log_flush(); - qemu_log_unlock(); + qemu_log_unlock(logfile); qemu_log_close(); } va_end(ap2); -- cgit v1.2.3