From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCGpp-0007Ml-Lc for qemu-devel@nongnu.org; Sun, 22 Nov 2009 13:06:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCGpk-0007M9-9S for qemu-devel@nongnu.org; Sun, 22 Nov 2009 13:06:52 -0500 Received: from [199.232.76.173] (port=43117 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCGpk-0007M6-2g for qemu-devel@nongnu.org; Sun, 22 Nov 2009 13:06:48 -0500 Received: from mail-yw0-f171.google.com ([209.85.211.171]:54963) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCGpj-00072y-JH for qemu-devel@nongnu.org; Sun, 22 Nov 2009 13:06:47 -0500 Received: by ywh1 with SMTP id 1so4152231ywh.18 for ; Sun, 22 Nov 2009 10:06:47 -0800 (PST) Message-ID: <4B097DB4.1050002@codemonkey.ws> Date: Sun, 22 Nov 2009 12:06:44 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 02/15] monitor: Command-line flag to enable control mode References: <1258643623-8636-1-git-send-email-lcapitulino@redhat.com> <1258643623-8636-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1258643623-8636-3-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, avi@redhat.com 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, > > Where 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 > --- > 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