All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>
Subject: [Qemu-devel] [PULL 16/16] vl: Deprecate -mon pretty=... for HMP monitors
Date: Mon, 17 Jun 2019 20:49:03 +0200	[thread overview]
Message-ID: <20190617184903.19436-17-armbru@redhat.com> (raw)
In-Reply-To: <20190617184903.19436-1-armbru@redhat.com>

From: Kevin Wolf <kwolf@redhat.com>

The -mon pretty=on|off switch of the -mon option applies only to QMP
monitors. It's silently ignored for HMP. Deprecate this combination so
that we can make it an error in future versions.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20190613153405.24769-16-kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qemu-deprecated.texi |  6 ++++++
 vl.c                 | 10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 50292d820b..df04f2840b 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -72,6 +72,12 @@ backend settings instead of environment variables.  To ease migration to
 the new format, the ``-audiodev-help'' option can be used to convert
 the current values of the environment variables to ``-audiodev'' options.
 
+@subsection -mon ...,control=readline,pretty=on|off (since 4.1)
+
+The @code{pretty=on|off} switch has no effect for HMP monitors, but is
+silently ignored. Using the switch with HMP monitors will become an
+error in the future.
+
 @subsection -realtime (since 4.1)
 
 The @code{-realtime mlock=on|off} argument has been replaced by the
diff --git a/vl.c b/vl.c
index 32daa434eb..99a56b5556 100644
--- a/vl.c
+++ b/vl.c
@@ -2317,6 +2317,10 @@ static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
         return -1;
     }
 
+    if (!qmp && qemu_opt_get(opts, "pretty")) {
+        warn_report("'pretty' is deprecated for HMP monitors, it has no effect "
+                    "and will be removed in future versions");
+    }
     if (qemu_opt_get_bool(opts, "pretty", 0)) {
         pretty = true;
     }
@@ -2362,7 +2366,11 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty)
     opts = qemu_opts_create(qemu_find_opts("mon"), label, 1, &error_fatal);
     qemu_opt_set(opts, "mode", mode, &error_abort);
     qemu_opt_set(opts, "chardev", label, &error_abort);
-    qemu_opt_set_bool(opts, "pretty", pretty, &error_abort);
+    if (!strcmp(mode, "control")) {
+        qemu_opt_set_bool(opts, "pretty", pretty, &error_abort);
+    } else {
+        assert(pretty == false);
+    }
     monitor_device_index++;
 }
 
-- 
2.21.0



  parent reply	other threads:[~2019-06-17 19:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 18:48 [Qemu-devel] [PULL 00/16] Monitor patches for 2019-06-17 Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 01/16] monitor: Fix return type of monitor_fdset_dup_fd_find Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 02/16] monitor: Remove unused password prompting fields Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 03/16] monitor: Split monitor_init in HMP and QMP function Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 04/16] monitor: Make MonitorQMP a child class of Monitor Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 05/16] monitor: Create MonitorHMP with readline state Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 06/16] monitor: Remove Monitor.cmd_table indirection Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 07/16] monitor: Rename HMP command type and tables Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 08/16] Move monitor.c to monitor/misc.c Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 09/16] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 10/16] monitor: Create monitor-internal.h with common definitions Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 11/16] monitor: Split out monitor/qmp.c Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 12/16] monitor: Split out monitor/hmp.c Markus Armbruster
2019-06-17 18:49 ` [Qemu-devel] [PULL 13/16] monitor: Split out monitor/monitor.c Markus Armbruster
2019-06-17 18:49 ` [Qemu-devel] [PULL 14/16] monitor: Split Monitor.flags into separate bools Markus Armbruster
2019-06-17 18:49 ` [Qemu-devel] [PULL 15/16] monitor: Replace monitor_init() with monitor_init_{hmp, qmp}() Markus Armbruster
2019-06-17 18:49 ` Markus Armbruster [this message]
2019-06-18  9:01   ` [Qemu-devel] [PULL 16/16] vl: Deprecate -mon pretty=... for HMP monitors Daniel P. Berrangé
2019-06-18 10:34     ` Kevin Wolf
2019-06-19  6:42       ` Markus Armbruster
2019-06-19  9:18         ` Kevin Wolf
2019-06-19  9:20           ` Daniel P. Berrangé
2019-06-17 18:58 ` [Qemu-devel] [PULL 00/16] Monitor patches for 2019-06-17 Peter Maydell
2019-06-18  6:07   ` Markus Armbruster
2019-06-17 20:04 ` no-reply
2019-06-17 22:49 ` no-reply

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=20190617184903.19436-17-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=kwolf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.