qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Markus Armbruster" <armbru@redhat.com>,
	"Luiz Capitulino" <lcapitulino@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Kővágó, Zoltán" <DirtY.iCE.hu@gmail.com>
Subject: [Qemu-devel] [PULL 15/20] audio: remove LOG_TO_MONITOR along with default_mon
Date: Mon, 15 Jun 2015 14:28:06 +0200	[thread overview]
Message-ID: <1434371291-6994-16-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1434371291-6994-1-git-send-email-kraxel@redhat.com>

From: Kővágó, Zoltán <dirty.ice.hu@gmail.com>

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             | 23 +++--------------------
 include/monitor/monitor.h |  1 -
 monitor.c                 |  4 ----
 3 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/audio/audio.c b/audio/audio.c
index 9d018e9..cb1cba9 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -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 */ }
 };
 
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 57f8394..88644ce 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -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
diff --git a/monitor.c b/monitor.c
index 6a46424..8e1a2e8 100644
--- 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,
-- 
1.8.3.1

  parent reply	other threads:[~2015-06-15 12:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 12:27 [Qemu-devel] [PULL 00/20] audio patch queue Gerd Hoffmann
2015-06-15 12:27 ` [Qemu-devel] [PULL 01/20] audio: remove esd backend Gerd Hoffmann
2015-06-15 12:27 ` [Qemu-devel] [PULL 02/20] audio: remove fmod backend Gerd Hoffmann
2015-06-15 12:27 ` [Qemu-devel] [PULL 03/20] audio: remove winwave audio driver Gerd Hoffmann
2015-06-15 12:27 ` [Qemu-devel] [PULL 04/20] only enable dsound in case the header file is present Gerd Hoffmann
2015-06-15 12:27 ` [Qemu-devel] [PULL 05/20] audio: expose drv_opaque to init_out and init_in Gerd Hoffmann
2015-06-15 12:27 ` [Qemu-devel] [PULL 06/20] paaudio: do not use global variables Gerd Hoffmann
2015-06-15 12:27 ` [Qemu-devel] [PULL 07/20] alsaaudio: " Gerd Hoffmann
2015-06-15 12:27 ` [Qemu-devel] [PULL 08/20] ossaudio: " Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 09/20] wavaudio: " Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 10/20] paaudio: fix possible resource leak Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 11/20] dsoundaudio: do not use global variables Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 12/20] coreaudio: do not use global variables where possible Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 13/20] sdlaudio: do not allow multiple instances Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 14/20] MAINTAINERS: remove malc from audio Gerd Hoffmann
2015-06-15 12:28 ` Gerd Hoffmann [this message]
2015-06-15 12:28 ` [Qemu-devel] [PULL 16/20] audio: remove plive Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 17/20] dsoundaudio: remove *_retries kludges Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 18/20] dsoundaudio: remove primary buffer Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 19/20] alsaaudio: use trace events instead of verbose Gerd Hoffmann
2015-06-15 12:28 ` [Qemu-devel] [PULL 20/20] ossaudio: use trace events instead of debug config flag Gerd Hoffmann
2015-06-15 17:03 ` [Qemu-devel] [PULL 00/20] audio patch queue Peter Maydell
2015-06-15 17:05   ` Peter Maydell
2015-06-16  7:50     ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434371291-6994-16-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=DirtY.iCE.hu@gmail.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).