mirror of https://github.com/xemu-project/xemu.git
linux-user: Use qemu_set_log_filename_flags
Perform all logfile setup 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-30-richard.henderson@linaro.org>
This commit is contained in:
parent
905c78fe60
commit
b410253f9f
|
@ -85,6 +85,7 @@ static bool enable_strace;
|
||||||
* Used to support command line arguments overriding environment variables.
|
* Used to support command line arguments overriding environment variables.
|
||||||
*/
|
*/
|
||||||
static int last_log_mask;
|
static int last_log_mask;
|
||||||
|
static const char *last_log_filename;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When running 32-on-64 we should make sure we can fit all of the possible
|
* When running 32-on-64 we should make sure we can fit all of the possible
|
||||||
|
@ -257,7 +258,7 @@ static void handle_arg_dfilter(const char *arg)
|
||||||
|
|
||||||
static void handle_arg_log_filename(const char *arg)
|
static void handle_arg_log_filename(const char *arg)
|
||||||
{
|
{
|
||||||
qemu_set_log_filename(arg, &error_fatal);
|
last_log_filename = arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_arg_set_env(const char *arg)
|
static void handle_arg_set_env(const char *arg)
|
||||||
|
@ -643,7 +644,6 @@ int main(int argc, char **argv, char **envp)
|
||||||
int i;
|
int i;
|
||||||
int ret;
|
int ret;
|
||||||
int execfd;
|
int execfd;
|
||||||
int log_mask;
|
|
||||||
unsigned long max_reserved_va;
|
unsigned long max_reserved_va;
|
||||||
bool preserve_argv0;
|
bool preserve_argv0;
|
||||||
|
|
||||||
|
@ -677,10 +677,9 @@ int main(int argc, char **argv, char **envp)
|
||||||
|
|
||||||
optind = parse_args(argc, argv);
|
optind = parse_args(argc, argv);
|
||||||
|
|
||||||
log_mask = last_log_mask | (enable_strace ? LOG_STRACE : 0);
|
qemu_set_log_filename_flags(last_log_filename,
|
||||||
if (log_mask) {
|
last_log_mask | (enable_strace * LOG_STRACE),
|
||||||
qemu_set_log(log_mask, &error_fatal);
|
&error_fatal);
|
||||||
}
|
|
||||||
|
|
||||||
if (!trace_init_backends()) {
|
if (!trace_init_backends()) {
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Reference in New Issue