summaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2010-03-17 14:52:30 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-19 15:27:39 -0500
commitd49f626ed00cecc90fb1ff88da9bdf11e57094d1 (patch)
treee519af9e19e03f17b9b053768ddc996ae3eaaab3 /vl.c
parent8af8ce4d6116e3d46ad298ca8fe50d3b515b1aac (diff)
downloadhqemu-d49f626ed00cecc90fb1ff88da9bdf11e57094d1.zip
hqemu-d49f626ed00cecc90fb1ff88da9bdf11e57094d1.tar.gz
qmp: don't make -qmp disable the default monitor
Instead, we introduce a default_qmp flag. We don't use it yet, but will in the next patch. This has a user-visible impact as specifying just -qmp will now also show a monitor on the 'vc'. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index eda96aa..e14f45e 100644
--- a/vl.c
+++ b/vl.c
@@ -273,6 +273,7 @@ static int default_vga = 1;
static int default_floppy = 1;
static int default_cdrom = 1;
static int default_sdcard = 1;
+static int default_qmp = 1;
static struct {
const char *driver;
@@ -4269,15 +4270,22 @@ int main(int argc, char **argv, char **envp)
break;
case QEMU_OPTION_qmp:
monitor_parse(optarg, "control");
- default_monitor = 0;
+ default_qmp = 0;
break;
case QEMU_OPTION_mon:
opts = qemu_opts_parse(&qemu_mon_opts, optarg, 1);
if (!opts) {
fprintf(stderr, "parse error: %s\n", optarg);
exit(1);
+ } else {
+ const char *mode;
+ mode = qemu_opt_get(opts, "mode");
+ if (mode == NULL || strcmp(mode, "readline") == 0) {
+ default_monitor = 0;
+ } else if (strcmp(mode, "control") == 0) {
+ default_qmp = 0;
+ }
}
- default_monitor = 0;
break;
case QEMU_OPTION_chardev:
opts = qemu_opts_parse(&qemu_chardev_opts, optarg, 1);
@@ -4515,6 +4523,7 @@ int main(int argc, char **argv, char **envp)
default_parallel = 0;
default_virtcon = 0;
default_monitor = 0;
+ default_qmp = 0;
default_vga = 0;
default_net = 0;
default_floppy = 0;
OpenPOWER on IntegriCloud