Received: from eggs.gnu.org ([2001:4830:134:3::10]:49181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4TV1-0006mk-4r for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:28:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4TUy-00063I-MH for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:28:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4TUy-00062K-71 for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:28:20 -0400 From: Gerd Hoffmann Date: Mon, 15 Jun 2015 14:28:06 +0200 Message-Id: <1434371291-6994-16-git-send-email-kraxel@redhat.com> In-Reply-To: <1434371291-6994-1-git-send-email-kraxel@redhat.com> References: <1434371291-6994-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 15/20] audio: remove LOG_TO_MONITOR along with default_mon List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster , Luiz Capitulino , Gerd Hoffmann , =?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?= From: K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n Setting QEMU_AUDIO_LOG_TO_MONITOR=3D1 can crash qemu (if qemu tries to lo= g 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=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n Signed-off-by: Gerd Hoffmann --- 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 =3D { @@ -97,7 +96,6 @@ static struct { =20 .period =3D { .hertz =3D 100 }, .plive =3D 0, - .log_to_monitor =3D 0, .try_poll_in =3D 1, .try_poll_out =3D 1, }; @@ -331,20 +329,11 @@ static const char *audio_get_conf_str (const char *= key, =20 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); - } =20 - vfprintf (stderr, fmt, ap); - } + vfprintf(stderr, fmt, ap); } =20 void AUD_log (const char *cap, const char *fmt, ...) @@ -1654,12 +1643,6 @@ static struct audio_option audio_options[] =3D { .valp =3D &conf.plive, .descr =3D "(undocumented)" }, - { - .name =3D "LOG_TO_MONITOR", - .tag =3D AUD_OPT_BOOL, - .valp =3D &conf.log_to_monitor, - .descr =3D "Print logging messages to monitor instead of stderr" - }, { /* End of list */ } }; =20 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" =20 extern Monitor *cur_mon; -extern Monitor *default_mon; =20 /* 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[]; =20 Monitor *cur_mon; -Monitor *default_mon; =20 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 =3D mon; } =20 static void bdrv_password_cb(void *opaque, const char *password, --=20 1.8.3.1