From e144a605a614d22165000c69e8e1dc6986d45cd8 Mon Sep 17 00:00:00 2001 From: Salvador Fandino Date: Thu, 23 Jan 2020 20:36:26 +0100 Subject: qemu_set_log_filename: filename argument may be NULL NULL is a valid log filename used to indicate we want to use stderr but qemu_set_log_filename (which is called by bsd-user/main.c) was not handling it correctly. That also made redundant a couple of NULL checks in calling code which have been removed. Signed-off-by: Salvador Fandino Message-Id: <20200123193626.19956-1-salvador@qindel.com> Signed-off-by: Stefan Hajnoczi --- trace/control.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'trace') diff --git a/trace/control.c b/trace/control.c index 0fb8124..6c775e6 100644 --- a/trace/control.c +++ b/trace/control.c @@ -229,9 +229,7 @@ void trace_init_file(const char *file) /* If both the simple and the log backends are enabled, "--trace file" * only applies to the simple backend; use "-D" for the log backend. */ - if (file) { - qemu_set_log_filename(file, &error_fatal); - } + qemu_set_log_filename(file, &error_fatal); #else if (file) { fprintf(stderr, "error: --trace file=...: " -- cgit v1.1