From patchwork Fri Jun 12 12:33:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?B?Wm9sdMOhbiBLxZF2w6Fnw7M=?= X-Patchwork-Id: 483537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D8AB140497 for ; Fri, 12 Jun 2015 22:33:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=P5SQMHvp; dkim-atps=neutral Received: from localhost ([::1]:51031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3O9d-0008Dx-SP for incoming@patchwork.ozlabs.org; Fri, 12 Jun 2015 08:33:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3O92-0007EM-1h for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:33:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3O8z-0004Ck-KJ for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:33:12 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:35133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3O8z-0004CW-Cn for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:33:09 -0400 Received: by wiga1 with SMTP id a1so16036746wig.0 for ; Fri, 12 Jun 2015 05:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=3MvXlHUB7VUq4+hScwj2e+4D+3S01+jQeSsxiWxln9E=; b=P5SQMHvplRQDBw9ek7DmBUb3AcR7fVAykFO4eI4X9MWjN+hkSHRKY26aaP+PdCzwwn JbeVQY0BVNcO20q3ZaQtLmrUx9qolAhHJdLvY/n01CMwERTgkYmvp3YRF/5zihm7T2fW k5TG4wiOuEaMG7yETecsiufriOKiUA30pNtciMUASsgQ6c5JGX4161J3mnS3JElocrTK IDlPshTzK0RXMqcZIoradRyPF56cyjRZc/4U0C/+Ry8cPlbc/IysjBevpb4pu/lN3j3o MmNDxkNCFm97RU9qUTJ7oFRbmJxYUVEsWQHQUa7MrxkZ/DQmUdRhKZW+b1oWH5gOxGTI iUsA== X-Received: by 10.180.9.111 with SMTP id y15mr6569183wia.18.1434112388783; Fri, 12 Jun 2015 05:33:08 -0700 (PDT) Received: from nullptr.home.dirty-ice.org (94-21-76-230.pool.digikabel.hu. [94.21.76.230]) by mx.google.com with ESMTPSA id m2sm2569153wiy.7.2015.06.12.05.33.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 05:33:07 -0700 (PDT) From: "=?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?=" X-Google-Original-From: =?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?= To: qemu-devel@nongnu.org Date: Fri, 12 Jun 2015 14:33:02 +0200 Message-Id: <07c9d8a5e66f6b1bbe57a72a45dd6cbddeaecdba.1434111578.git.DirtY.iCE.hu@gmail.com> X-Mailer: git-send-email 2.4.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::234 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 01/12] audio: remove LOG_TO_MONITOR along with default_mon X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 9afee7b..06aee1f 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); @@ -5270,9 +5269,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,