Skip to content

Commit

Permalink
monitor: deprecate 'default' option
Browse files Browse the repository at this point in the history
This option does nothing since commit 06ac27f.  Deprecate it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
elmarco authored and Michael Tokarev committed Oct 28, 2016
1 parent e7709b4 commit bdbcb54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/monitor/monitor.h
Expand Up @@ -9,7 +9,7 @@
extern Monitor *cur_mon;

/* flags for monitor_init */
#define MONITOR_IS_DEFAULT 0x01
/* 0x01 unused */
#define MONITOR_USE_READLINE 0x02
#define MONITOR_USE_CONTROL 0x04
#define MONITOR_USE_PRETTY 0x08
Expand Down
2 changes: 1 addition & 1 deletion monitor.c
Expand Up @@ -4094,7 +4094,7 @@ QemuOptsList qemu_mon_opts = {
.name = "chardev",
.type = QEMU_OPT_STRING,
},{
.name = "default",
.name = "default", /* deprecated */
.type = QEMU_OPT_BOOL,
},{
.name = "pretty",
Expand Down
8 changes: 4 additions & 4 deletions qemu-options.hx
Expand Up @@ -2239,7 +2239,7 @@ two serial ports and the QEMU monitor:

@example
-chardev stdio,mux=on,id=char0 \
-mon chardev=char0,mode=readline,default \
-mon chardev=char0,mode=readline \
-serial chardev:char0 \
-serial chardev:char0
@end example
Expand All @@ -2250,7 +2250,7 @@ multiplexed between the QEMU monitor and a parallel port:

@example
-chardev stdio,mux=on,id=char0 \
-mon chardev=char0,mode=readline,default \
-mon chardev=char0,mode=readline \
-parallel chardev:char0 \
-chardev tcp,...,mux=on,id=char1 \
-serial chardev:char1 \
Expand Down Expand Up @@ -3112,9 +3112,9 @@ Like -qmp but uses pretty JSON formatting.
ETEXI
DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
"-mon [chardev=]name[,mode=readline|control][,default]\n", QEMU_ARCH_ALL)
"-mon [chardev=]name[,mode=readline|control]\n", QEMU_ARCH_ALL)
STEXI
@item -mon [chardev=]name[,mode=readline|control][,default]
@item -mon [chardev=]name[,mode=readline|control]
@findex -mon
Setup monitor on chardev @var{name}.
ETEXI
Expand Down
11 changes: 3 additions & 8 deletions vl.c
Expand Up @@ -2408,8 +2408,9 @@ static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
if (qemu_opt_get_bool(opts, "pretty", 0))
flags |= MONITOR_USE_PRETTY;

if (qemu_opt_get_bool(opts, "default", 0))
flags |= MONITOR_IS_DEFAULT;
if (qemu_opt_get_bool(opts, "default", 0)) {
error_report("option 'default' does nothing and is deprecated");
}

chardev = qemu_opt_get(opts, "chardev");
chr = qemu_chr_find(chardev);
Expand All @@ -2428,16 +2429,12 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty)
QemuOpts *opts;
const char *p;
char label[32];
int def = 0;

if (strstart(optarg, "chardev:", &p)) {
snprintf(label, sizeof(label), "%s", p);
} else {
snprintf(label, sizeof(label), "compat_monitor%d",
monitor_device_index);
if (monitor_device_index == 0) {
def = 1;
}
opts = qemu_chr_parse_compat(label, optarg);
if (!opts) {
error_report("parse error: %s", optarg);
Expand All @@ -2449,8 +2446,6 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty)
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 (def)
qemu_opt_set(opts, "default", "on", &error_abort);
monitor_device_index++;
}

Expand Down

0 comments on commit bdbcb54

Please sign in to comment.