diff options
-rw-r--r-- | audio/audio.c | 4 | ||||
-rw-r--r-- | monitor.c | 7 | ||||
-rw-r--r-- | monitor.h | 1 | ||||
-rw-r--r-- | slirp/misc.c | 2 | ||||
-rw-r--r-- | vnc.c | 5 |
5 files changed, 10 insertions, 9 deletions
diff --git a/audio/audio.c b/audio/audio.c index 2a20e5be1b..dbf0b96f33 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -330,10 +330,10 @@ void AUD_vlog (const char *cap, const char *fmt, va_list ap) { if (conf.log_to_monitor) { if (cap) { - monitor_printf(cur_mon, "%s: ", cap); + monitor_printf(default_mon, "%s: ", cap); } - monitor_vprintf(cur_mon, fmt, ap); + monitor_vprintf(default_mon, fmt, ap); } else { if (cap) { @@ -177,7 +177,8 @@ static QLIST_HEAD(mon_list, Monitor) mon_list; static const mon_cmd_t mon_cmds[]; static const mon_cmd_t info_cmds[]; -Monitor *cur_mon = NULL; +Monitor *cur_mon; +Monitor *default_mon; static void monitor_command_cb(Monitor *mon, const char *cmdline, void *opaque); @@ -4624,8 +4625,8 @@ void monitor_init(CharDriverState *chr, int flags) } QLIST_INSERT_HEAD(&mon_list, mon, entry); - if (!cur_mon || (flags & MONITOR_IS_DEFAULT)) - cur_mon = mon; + if (!default_mon || (flags & MONITOR_IS_DEFAULT)) + default_mon = mon; } static void bdrv_password_cb(Monitor *mon, const char *password, void *opaque) @@ -7,6 +7,7 @@ #include "block.h" extern Monitor *cur_mon; +extern Monitor *default_mon; /* flags for monitor_init */ #define MONITOR_IS_DEFAULT 0x01 diff --git a/slirp/misc.c b/slirp/misc.c index dcb1dc117b..1aeb401082 100644 --- a/slirp/misc.c +++ b/slirp/misc.c @@ -260,7 +260,7 @@ void lprint(const char *format, ...) va_list args; va_start(args, format); - monitor_vprintf(cur_mon, format, args); + monitor_vprintf(default_mon, format, args); va_end(args); } @@ -1046,11 +1046,10 @@ static void audio_capture(void *opaque, void *buf, int size) static void audio_add(VncState *vs) { - Monitor *mon = cur_mon; struct audio_capture_ops ops; if (vs->audio_cap) { - monitor_printf(mon, "audio already running\n"); + monitor_printf(default_mon, "audio already running\n"); return; } @@ -1060,7 +1059,7 @@ static void audio_add(VncState *vs) vs->audio_cap = AUD_add_capture(&vs->as, &ops, vs); if (!vs->audio_cap) { - monitor_printf(mon, "Failed to add audio capture\n"); + monitor_printf(default_mon, "Failed to add audio capture\n"); } } |