qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Adam Litke <agl@us.ibm.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Avi Kivity <avi@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
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	[thread overview]
Message-ID: <1299884745-521-10-git-send-email-aliguori@us.ibm.com> (raw)
In-Reply-To: <1299884745-521-1-git-send-email-aliguori@us.ibm.com>

This is temporary until we implement all QMP commands.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

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

  parent reply	other threads:[~2011-03-11 23:06 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 23:05 [Qemu-devel] [PATCH 00/15] QAPI Round 1 (core code generator) (v2) Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 01/15] qapi: add code generator for qmp-types (v2) Anthony Liguori
2011-03-11 23:12   ` [Qemu-devel] " Anthony Liguori
2011-03-12 11:29   ` [Qemu-devel] " Blue Swirl
2011-03-12 15:00     ` Anthony Liguori
2011-03-18 14:18       ` Luiz Capitulino
2011-03-18 14:14   ` [Qemu-devel] " Luiz Capitulino
2011-03-11 23:05 ` [Qemu-devel] [PATCH 02/15] qapi: add code generator for type marshallers Anthony Liguori
2011-03-18 15:13   ` [Qemu-devel] " Luiz Capitulino
2011-03-11 23:05 ` [Qemu-devel] [PATCH 03/15] qapi: add core QMP server support (v2) Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 04/15] qapi: add signal support to core QMP server Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 05/15] qapi: add QAPI module type Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 06/15] qapi: add code generators for QMP command marshaling Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 07/15] qapi: add query-version QMP command Anthony Liguori
2011-03-12 11:19   ` Blue Swirl
2011-03-12 15:06     ` Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 08/15] qapi: add new QMP server that uses CharDriverState (v2) Anthony Liguori
2011-03-11 23:05 ` Anthony Liguori [this message]
2011-03-11 23:14   ` [Qemu-devel] Re: [PATCH 09/15] vl: add a new -qmp2 option to expose experimental QMP server Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 10/15] qapi: add QMP quit command Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 11/15] qapi: add QMP qmp_capabilities command Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 12/15] qapi: add QMP put-event command Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 13/15] qapi: add code generator for libqmp (v2) Anthony Liguori
2011-03-12 11:10   ` Blue Swirl
2011-03-12 14:53     ` Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 14/15] qapi: add test-libqmp Anthony Liguori
2011-03-12 11:23   ` Blue Swirl
2011-03-12 14:59     ` Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 15/15] qapi: generate HTML report for test-libqmp Anthony Liguori
2011-03-16 14:34 ` [Qemu-devel] Re: [PATCH 00/15] QAPI Round 1 (core code generator) (v2) Luiz Capitulino
2011-03-16 14:49   ` Paolo Bonzini
2011-03-16 15:00     ` Luiz Capitulino
2011-03-16 16:06       ` Anthony Liguori
2011-03-16 16:03     ` Anthony Liguori
2011-03-16 16:31       ` Paolo Bonzini
2011-03-16 18:06         ` Anthony Liguori
2011-03-16 15:59   ` Anthony Liguori
2011-03-16 18:09     ` Luiz Capitulino
2011-03-16 18:32       ` Anthony Liguori
2011-03-16 19:27         ` Luiz Capitulino
2011-03-16 20:00           ` Anthony Liguori
2011-03-18 14:10             ` Luiz Capitulino
2011-03-18 14:22               ` Anthony Liguori
2011-03-17 12:21     ` Kevin Wolf
2011-03-17 12:46       ` Anthony Liguori
2011-03-17 13:15         ` Kevin Wolf
2011-03-17 13:28           ` Anthony Liguori
2011-03-17 14:04             ` Kevin Wolf
2011-03-17 15:49               ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1299884745-521-10-git-send-email-aliguori@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=agl@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).