softmmu: Use qemu_set_log_filename_flags

Perform all logfile setup at startup in one step.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220417183019.755276-31-richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2022-04-17 11:30:10 -07:00
parent b410253f9f
commit b2528af10a
1 changed files with 9 additions and 12 deletions

View File

@ -2560,19 +2560,16 @@ static void qemu_process_early_options(void)
#endif #endif
/* Open the logfile at this point and set the log mask if necessary. */ /* Open the logfile at this point and set the log mask if necessary. */
if (log_file) { {
qemu_set_log_filename(log_file, &error_fatal); int mask = 0;
} if (log_mask) {
if (log_mask) { mask = qemu_str_to_log_mask(log_mask);
int mask; if (!mask) {
mask = qemu_str_to_log_mask(log_mask); qemu_print_log_usage(stdout);
if (!mask) { exit(1);
qemu_print_log_usage(stdout); }
exit(1);
} }
qemu_set_log(mask, &error_fatal); qemu_set_log_filename_flags(log_file, mask, &error_fatal);
} else {
qemu_set_log(0, &error_fatal);
} }
qemu_add_default_firmwarepath(); qemu_add_default_firmwarepath();