qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 02/15] monitor: Command-line flag to enable cont


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 02/15] monitor: Command-line flag to enable control mode
Date: Sun, 22 Nov 2009 12:06:44 -0600
User-agent: Thunderbird 2.0.0.23 (X11/20090825)

Luiz Capitulino wrote:
This commit adds a flag called 'control' to the '-monitor'
command-line option. This flag enables control mode.

The syntax is:

qemu [...] -monitor control,<device>

Where <device> is a chardev (excluding 'vc', for obvious reasons).

For example:

$ qemu [...] -monitor control,tcp:localhost:4444,server

Will run QEMU in control mode, waiting for a client TCP connection
on localhost port 4444.

TODO: Update manpage.

Signed-off-by: Luiz Capitulino <address@hidden>
---
 monitor.c |   18 ++++++++++++++++++
 monitor.h |    1 +
 vl.c      |   11 +++++++----
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/monitor.c b/monitor.c
index e7c6451..a98dc42 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3616,6 +3616,24 @@ static void monitor_event(void *opaque, int event)
  * End:
  */
+const char *monitor_cmdline_parse(const char *cmdline, int *flags)
+{
+    const char *dev;
+
+    if (strstart(cmdline, "control,", &dev)) {
+        if (strstart(dev, "vc", NULL)) {
+            fprintf(stderr, "qemu: control mode is for low-level interaction 
");
+            fprintf(stderr, "cannot be used with device 'vc'\n");
+            exit(1);
+        }
+        *flags &= ~MONITOR_USE_READLINE;
+        *flags |= MONITOR_USE_CONTROL;
+        return dev;
+    }
+
+    return cmdline;
+}

Should use QemuOpts for this.

Regards,

Anthony Liguori




reply via email to

[Prev in Thread] Current Thread [Next in Thread]