]> git.proxmox.com Git - mirror_qemu.git/commitdiff
audio: remove LOG_TO_MONITOR along with default_mon
authorKővágó, Zoltán <dirty.ice.hu@gmail.com>
Fri, 12 Jun 2015 12:33:02 +0000 (14:33 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 15 Jun 2015 10:42:48 +0000 (12:42 +0200)
Setting QEMU_AUDIO_LOG_TO_MONITOR=1 can crash qemu (if qemu tries to log
to the monitor before it's being initialized), and also nothing else in
qemu logs to the monitor.

This log to monitor feature was the last thing that used the default_mon
variable, so I removed it too (as using it can cause problems).

Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
audio/audio.c
include/monitor/monitor.h
monitor.c

index 9d018e9ded1c8377501125f7242516814dbf3e26..cb1cba9236fc26839a45f1ae39e354394a4aad28 100644 (file)
@@ -67,7 +67,6 @@ static struct {
         int64_t ticks;
     } period;
     int plive;
-    int log_to_monitor;
     int try_poll_in;
     int try_poll_out;
 } conf = {
@@ -97,7 +96,6 @@ static struct {
 
     .period = { .hertz = 100 },
     .plive = 0,
-    .log_to_monitor = 0,
     .try_poll_in = 1,
     .try_poll_out = 1,
 };
@@ -331,20 +329,11 @@ static const char *audio_get_conf_str (const char *key,
 
 void AUD_vlog (const char *cap, const char *fmt, va_list ap)
 {
-    if (conf.log_to_monitor) {
-        if (cap) {
-            monitor_printf(default_mon, "%s: ", cap);
-        }
-
-        monitor_vprintf(default_mon, fmt, ap);
+    if (cap) {
+        fprintf(stderr, "%s: ", cap);
     }
-    else {
-        if (cap) {
-            fprintf (stderr, "%s: ", cap);
-        }
 
-        vfprintf (stderr, fmt, ap);
-    }
+    vfprintf(stderr, fmt, ap);
 }
 
 void AUD_log (const char *cap, const char *fmt, ...)
@@ -1654,12 +1643,6 @@ static struct audio_option audio_options[] = {
         .valp  = &conf.plive,
         .descr = "(undocumented)"
     },
-    {
-        .name  = "LOG_TO_MONITOR",
-        .tag   = AUD_OPT_BOOL,
-        .valp  = &conf.log_to_monitor,
-        .descr = "Print logging messages to monitor instead of stderr"
-    },
     { /* End of list */ }
 };
 
index 57f8394a94408e9202200d10a852e5b538122a03..88644ceda7c8aa584a014b028fc8db47f31203a6 100644 (file)
@@ -8,7 +8,6 @@
 #include "qemu/readline.h"
 
 extern Monitor *cur_mon;
-extern Monitor *default_mon;
 
 /* flags for monitor_init */
 #define MONITOR_IS_DEFAULT    0x01
index 6a4642493a438638e32415b70625a7fea5425586..8e1a2e85b8f428710aa797774d62eb799f03f083 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -226,7 +226,6 @@ static mon_cmd_t info_cmds[];
 static const mon_cmd_t qmp_cmds[];
 
 Monitor *cur_mon;
-Monitor *default_mon;
 
 static void monitor_command_cb(void *opaque, const char *cmdline,
                                void *readline_opaque);
@@ -5298,9 +5297,6 @@ void monitor_init(CharDriverState *chr, int flags)
     qemu_mutex_lock(&monitor_lock);
     QLIST_INSERT_HEAD(&mon_list, mon, entry);
     qemu_mutex_unlock(&monitor_lock);
-
-    if (!default_mon || (flags & MONITOR_IS_DEFAULT))
-        default_mon = mon;
 }
 
 static void bdrv_password_cb(void *opaque, const char *password,