From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHcx0-0005UE-7X for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHcwu-0005Pm-Fe for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:25 -0500 Received: from [199.232.76.173] (port=58693 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHcwu-0005PU-6C for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31223) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHcws-0000hf-Lc for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:19 -0500 From: Gerd Hoffmann Date: Mon, 7 Dec 2009 13:42:51 +0100 Message-Id: <1260189773-20728-20-git-send-email-kraxel@redhat.com> In-Reply-To: <1260189773-20728-1-git-send-email-kraxel@redhat.com> References: <1260189773-20728-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [FOR 0.12 PATCH v3 19/21] add -qmp convinience switch List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , agraf@suse.de, lcapitulino@redhat.com Signed-off-by: Gerd Hoffmann --- qemu-options.hx | 2 ++ vl.c | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 7234447..b8cc375 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 6411bd6..9949886 100644 --- a/vl.c +++ b/vl.c @@ -4662,7 +4662,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; @@ -4692,7 +4692,7 @@ static void monitor_parse(const char *optarg) fprintf(stderr, "fixme #2\n"); 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"); @@ -5283,7 +5283,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: @@ -5622,7 +5626,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) @@ -5630,7 +5634,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; -- 1.6.5.2