aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-12-08 13:11:52 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-12 07:59:43 -0600
commit6ca5582d4f06d8ff0c646b8fe3cfe721dc573597 (patch)
tree3ab8f319d95bf0fb7d70cd1e5a03b07f1500c581
parent22a0e04b9bb5a02e13b3e5cf5ea8abfac5f34120 (diff)
add -qmp convinience switch
Acts like -monitor but switched into qmp mode. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--qemu-options.hx2
-rw-r--r--vl.c14
2 files changed, 11 insertions, 5 deletions
diff --git a/qemu-options.hx b/qemu-options.hx
index 7234447e58..b8cc3750c0 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1588,6 +1588,8 @@ serial port).
The default device is @code{vc} in graphical mode and @code{stdio} in
non graphical mode.
ETEXI
+DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
+ "-qmp dev like -monitor but opens in 'control' mode.\n")
DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
"-mon chardev=[name][,mode=readline|control][,default]\n")
diff --git a/vl.c b/vl.c
index d90975fedd..ab77c35e16 100644
--- a/vl.c
+++ b/vl.c
@@ -4660,7 +4660,7 @@ static int mon_init_func(QemuOpts *opts, void *opaque)
return 0;
}
-static void monitor_parse(const char *optarg)
+static void monitor_parse(const char *optarg, const char *mode)
{
static int monitor_device_index = 0;
QemuOpts *opts;
@@ -4690,7 +4690,7 @@ static void monitor_parse(const char *optarg)
fprintf(stderr, "duplicate chardev: %s\n", label);
exit(1);
}
- qemu_opt_set(opts, "mode", "readline");
+ qemu_opt_set(opts, "mode", mode);
qemu_opt_set(opts, "chardev", label);
if (def)
qemu_opt_set(opts, "default", "on");
@@ -5281,7 +5281,11 @@ int main(int argc, char **argv, char **envp)
break;
}
case QEMU_OPTION_monitor:
- monitor_parse(optarg);
+ monitor_parse(optarg, "readline");
+ default_monitor = 0;
+ break;
+ case QEMU_OPTION_qmp:
+ monitor_parse(optarg, "control");
default_monitor = 0;
break;
case QEMU_OPTION_mon:
@@ -5617,7 +5621,7 @@ int main(int argc, char **argv, char **envp)
if (default_serial)
add_device_config(DEV_SERIAL, "stdio");
if (default_monitor)
- monitor_parse("stdio");
+ monitor_parse("stdio", "readline");
}
} else {
if (default_serial)
@@ -5625,7 +5629,7 @@ int main(int argc, char **argv, char **envp)
if (default_parallel)
add_device_config(DEV_PARALLEL, "vc:80Cx24C");
if (default_monitor)
- monitor_parse("vc:80Cx24C");
+ monitor_parse("vc:80Cx24C", "readline");
}
if (default_vga)
vga_interface_type = VGA_CIRRUS;