[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/22] vl: add a new -qmp2 option to expose experime
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 16/22] vl: add a new -qmp2 option to expose experimental QMP server |
Date: |
Sun, 6 Mar 2011 19:22:58 -0600 |
This is temporary until we implement all QMP commands.
Signed-off-by: Anthony Liguori <address@hidden>
diff --git a/qemu-options.hx b/qemu-options.hx
index badb730..957d935 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1881,6 +1881,9 @@ serial port).
The default device is @code{vc} in graphical mode and @code{stdio} in
non graphical mode.
ETEXI
+DEF("qmp2", HAS_ARG, QEMU_OPTION_qmp2, \
+ "-qmp2 chardev experimental QMP server\n",
+ QEMU_ARCH_ALL)
DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
"-qmp dev like -monitor but opens in 'control' mode\n",
QEMU_ARCH_ALL)
diff --git a/vl.c b/vl.c
index 68c6715..d1d0197 100644
--- a/vl.c
+++ b/vl.c
@@ -162,6 +162,7 @@ int main(int argc, char **argv)
#include "qemu-queue.h"
#include "cpus.h"
#include "arch_init.h"
+#include "qmp-core.h"
#include "ui/qemu-spice.h"
@@ -1917,6 +1918,8 @@ static const QEMUOption *lookup_opt(int argc, char **argv,
return popt;
}
+#define MAX_QMP_CHARDEVS 16
+
int main(int argc, char **argv, char **envp)
{
const char *gdbstub_dev = NULL;
@@ -1941,6 +1944,8 @@ int main(int argc, char **argv, char **envp)
const char *incoming = NULL;
int show_vnc_port = 0;
int defconfig = 1;
+ int nb_qmp_chardevs = 0;
+ const char *qmp_chardevs[MAX_QMP_CHARDEVS];
#ifdef CONFIG_SIMPLE_TRACE
const char *trace_file = NULL;
@@ -2391,6 +2396,13 @@ int main(int argc, char **argv, char **envp)
monitor_parse(optarg, "control");
default_monitor = 0;
break;
+ case QEMU_OPTION_qmp2:
+ if (nb_qmp_chardevs == MAX_QMP_CHARDEVS) {
+ fprintf(stderr, "-qmp: too many QMP chardevs\n");
+ exit(1);
+ }
+ qmp_chardevs[nb_qmp_chardevs++] = optarg;
+ break;
case QEMU_OPTION_mon:
opts = qemu_opts_parse(qemu_find_opts("mon"), optarg, 1);
if (!opts) {
@@ -3092,6 +3104,15 @@ int main(int argc, char **argv, char **envp)
}
#endif
+ for (i = 0; i < nb_qmp_chardevs; i++) {
+ CharDriverState *chr = qemu_chr_find(qmp_chardevs[i]);
+ if (chr == NULL) {
+ fprintf(stderr, "-qmp: unknown chardev `%s'\n", qmp_chardevs[i]);
+ exit(1);
+ }
+ qmp_init_chardev(chr);
+ }
+
/* display setup */
dpy_resize(ds);
dcl = ds->listeners;
--
1.7.0.4
- Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command, (continued)
- Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command, Anthony Liguori, 2011/03/09
- Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command, Avi Kivity, 2011/03/09
- Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command, Anthony Liguori, 2011/03/09
- Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command, Avi Kivity, 2011/03/10
- Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command, Avi Kivity, 2011/03/10
- Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command, Anthony Liguori, 2011/03/10
[Qemu-devel] [PATCH 07/22] json: propagate error from parser, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 02/22] qerror: expose a function to format an error, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 16/22] vl: add a new -qmp2 option to expose experimental QMP server,
Anthony Liguori <=
[Qemu-devel] [PATCH 11/22] qapi: add signal support to core QMP server, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 17/22] qapi: add QMP quit command, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 18/22] qapi: add QMP qmp_capabilities command, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 19/22] qapi: add QMP put-event command, Anthony Liguori, 2011/03/06