Skip to content

Commit

Permalink
add -silent option to silence logging
Browse files Browse the repository at this point in the history
  • Loading branch information
camthesaxman committed Apr 21, 2018
1 parent 0995aed commit 663d905
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions linux-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,17 @@ const char *qemu_uname_release;
by remapping the process stack directly at the right place */
unsigned long guest_stack_size = 8 * 1024 * 1024UL;

static int silent;

void gemu_log(const char *fmt, ...)
{
va_list ap;
if (!silent) {
va_list ap;

va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
}
}

#if defined(TARGET_I386)
Expand Down Expand Up @@ -4575,6 +4579,11 @@ static void handle_arg_version(const char *arg)
exit(EXIT_SUCCESS);
}

static void handle_arg_silent(const char *arg)
{
silent = 1;
}

static char *trace_file;
static void handle_arg_trace(const char *arg)
{
Expand Down Expand Up @@ -4635,6 +4644,8 @@ static const struct qemu_argument arg_table[] = {
"", "[[enable=]<pattern>][,events=<file>][,file=<file>]"},
{"version", "QEMU_VERSION", false, handle_arg_version,
"", "display version information and exit"},
{"silent", "", false, handle_arg_silent,
"", "silence all logging"},
{NULL, NULL, false, NULL, NULL, NULL}
};

Expand Down

0 comments on commit 663d905

Please sign in to comment.