[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/15] vl: add a new -qmp2 option to expose experime
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 09/15] vl: add a new -qmp2 option to expose experimental QMP server |
Date: |
Fri, 11 Mar 2011 17:05:39 -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 d27e750..1d1d536 100644
--- a/vl.c
+++ b/vl.c
@@ -160,6 +160,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"
@@ -1915,6 +1916,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;
@@ -1940,6 +1943,8 @@ int main(int argc, char **argv, char **envp)
int show_vnc_port = 0;
int defconfig = 1;
const char *trace_file = NULL;
+ int nb_qmp_chardevs = 0;
+ const char *qmp_chardevs[MAX_QMP_CHARDEVS];
atexit(qemu_run_exit_notifiers);
error_set_progname(argv[0]);
@@ -2387,6 +2392,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) {
@@ -3084,6 +3096,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
- [Qemu-devel] [PATCH 03/15] qapi: add core QMP server support (v2), (continued)
- [Qemu-devel] [PATCH 03/15] qapi: add core QMP server support (v2), Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 04/15] qapi: add signal support to core QMP server, Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 05/15] qapi: add QAPI module type, Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 01/15] qapi: add code generator for qmp-types (v2), Anthony Liguori, 2011/03/11
- [Qemu-devel] Re: [PATCH 01/15] qapi: add code generator for qmp-types (v2), Luiz Capitulino, 2011/03/18
- [Qemu-devel] [PATCH 08/15] qapi: add new QMP server that uses CharDriverState (v2), Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 09/15] vl: add a new -qmp2 option to expose experimental QMP server,
Anthony Liguori <=
- [Qemu-devel] [PATCH 10/15] qapi: add QMP quit command, Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 07/15] qapi: add query-version QMP command, Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 11/15] qapi: add QMP qmp_capabilities command, Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 06/15] qapi: add code generators for QMP command marshaling, Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 02/15] qapi: add code generator for type marshallers, Anthony Liguori, 2011/03/11
- [Qemu-devel] [PATCH 14/15] qapi: add test-libqmp, Anthony Liguori, 2011/03/11