aboutsummaryrefslogtreecommitdiff
path: root/trace/control.c
diff options
context:
space:
mode:
authorSalvador Fandino <salvador@qindel.com>2020-01-23 20:36:26 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2020-01-30 21:33:50 +0000
commite144a605a614d22165000c69e8e1dc6986d45cd8 (patch)
tree28a01420e1a82b85f248518c109d418176521903 /trace/control.c
parentd4aceb2eb78a5f15e94791a43732c24b52c35dc5 (diff)
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 <salvador@qindel.com> Message-Id: <20200123193626.19956-1-salvador@qindel.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace/control.c')
-rw-r--r--trace/control.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/trace/control.c b/trace/control.c
index 0fb8124160..6c775e68eb 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=...: "