add -silent option to silence logging
This commit is contained in:
parent
0995aedb78
commit
663d9059fa
|
@ -106,14 +106,18 @@ const char *qemu_uname_release;
|
||||||
by remapping the process stack directly at the right place */
|
by remapping the process stack directly at the right place */
|
||||||
unsigned long guest_stack_size = 8 * 1024 * 1024UL;
|
unsigned long guest_stack_size = 8 * 1024 * 1024UL;
|
||||||
|
|
||||||
|
static int silent;
|
||||||
|
|
||||||
void gemu_log(const char *fmt, ...)
|
void gemu_log(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
if (!silent) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vfprintf(stderr, fmt, ap);
|
vfprintf(stderr, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(TARGET_I386)
|
#if defined(TARGET_I386)
|
||||||
int cpu_get_pic_interrupt(CPUX86State *env)
|
int cpu_get_pic_interrupt(CPUX86State *env)
|
||||||
|
@ -4575,6 +4579,11 @@ static void handle_arg_version(const char *arg)
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handle_arg_silent(const char *arg)
|
||||||
|
{
|
||||||
|
silent = 1;
|
||||||
|
}
|
||||||
|
|
||||||
static char *trace_file;
|
static char *trace_file;
|
||||||
static void handle_arg_trace(const char *arg)
|
static void handle_arg_trace(const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -4635,6 +4644,8 @@ static const struct qemu_argument arg_table[] = {
|
||||||
"", "[[enable=]<pattern>][,events=<file>][,file=<file>]"},
|
"", "[[enable=]<pattern>][,events=<file>][,file=<file>]"},
|
||||||
{"version", "QEMU_VERSION", false, handle_arg_version,
|
{"version", "QEMU_VERSION", false, handle_arg_version,
|
||||||
"", "display version information and exit"},
|
"", "display version information and exit"},
|
||||||
|
{"silent", "", false, handle_arg_silent,
|
||||||
|
"", "silence all logging"},
|
||||||
{NULL, NULL, false, NULL, NULL, NULL}
|
{NULL, NULL, false, NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue