qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "armbru@redhat.com" <armbru@redhat.com>,
	"aliguori@us.ibm.com" <aliguori@us.ibm.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"avi@redhat.com" <avi@redhat.com>
Subject: [Qemu-devel] Re: [PATCH 2/3] QMP: Introduce commands documentation
Date: Wed, 19 May 2010 10:06:29 -0300	[thread overview]
Message-ID: <20100519100629.3009bee7@redhat.com> (raw)
In-Reply-To: <4BF3AC24.8050401@siemens.com>

On Wed, 19 May 2010 11:15:16 +0200
Jan Kiszka <jan.kiszka@siemens.com> wrote:

> Luiz Capitulino wrote:
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> > 
> > One of the most important missing feature in QMP today is its
> > supported commands documentation.
> > 
> > The plan is to make it part of self-description support, however
> > self-description is a big task we have been postponing for a
> > long time now and still don't know when it's going to be done.
> > 
> > In order not to compromise QMP adoption and make users' life easier,
> > this commit adds a simple text documentation which fully describes
> > all QMP supported commands.
> > 
> > This is not ideal for a number of reasons (harder to maintain,
> > text-only, etc) but does improve the current situation. To avoid at
> > least divering from the user monitor help and texi snippets, QMP bits
> > are also maintained inside qemu-monitor.hx, and hxtool is extended to
> > generate a single text file from them.
> > 
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> > ---
> >  Makefile        |    5 +-
> >  QMP/README      |    5 +-
> >  configure       |    4 +
> >  hxtool          |   44 ++-
> >  qemu-monitor.hx | 1314 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> >  5 files changed, 1367 insertions(+), 5 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 306a1a4..110698e 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -29,7 +29,7 @@ $(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
> >  LIBS+=-lz $(LIBS_TOOLS)
> > 
> >  ifdef BUILD_DOCS
> > -DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
> > +DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
> >  else
> >  DOCS=
> >  endif
> > @@ -259,6 +259,9 @@ qemu-options.texi: $(SRC_PATH)/qemu-options.hx
> >  qemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx
> >         $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
> > 
> > +QMP/qmp-commands.txt: $(SRC_PATH)/qemu-monitor.hx
> > +       $(call quiet-command,sh $(SRC_PATH)/hxtool -q < $< > $@,"  GEN   $@")
> > +
> >  qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
> >         $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
> > 
> > diff --git a/QMP/README b/QMP/README
> > index 9334c25..35a80c7 100644
> > --- a/QMP/README
> > +++ b/QMP/README
> > @@ -15,8 +15,9 @@ QMP is JSON[1] based and has the following features:
> > 
> >  For more information, please, refer to the following files:
> > 
> > -o qmp-spec.txt    QEMU Monitor Protocol current specification
> > -o qmp-events.txt  List of available asynchronous events
> > +o qmp-spec.txt      QEMU Monitor Protocol current specification
> > +o qmp-commands.txt  QMP supported commands
> > +o qmp-events.txt    List of available asynchronous events
> > 
> >  There are also two simple Python scripts available:
> > 
> > diff --git a/configure b/configure
> > index 36d028f..6738e0b 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2807,3 +2807,7 @@ ln -s $source_path/Makefile.user $d/Makefile
> >  if test "$static" = "no" -a "$user_pie" = "yes" ; then
> >    echo "QEMU_CFLAGS+=-fpie" > $d/config.mak
> >  fi
> > +
> > +if test "$docs" = "yes" ; then
> > +  mkdir -p QMP
> > +fi
> > diff --git a/hxtool b/hxtool
> > index 8f65532..d499dc0 100644
> > --- a/hxtool
> > +++ b/hxtool
> > @@ -7,7 +7,7 @@ hxtoh()
> >          case $str in
> >              HXCOMM*)
> >              ;;
> > -            STEXI*|ETEXI*) flag=$(($flag^1))
> > +            STEXI*|ETEXI*|SQMP*|EQMP*) flag=$(($flag^1))
> >              ;;
> >              *)
> >              test $flag -eq 1 && printf "%s\n" "$str"
> > @@ -38,6 +38,12 @@ hxtotexi()
> >              fi
> >              flag=0
> >              ;;
> > +            SQMP*|EQMP*)
> > +            if test $flag -eq 1 ; then
> > +                echo "line $line: syntax error: expected ETEXI, found $str" >&2
> > +                exit 1
> > +            fi
> > +            ;;
> >              DEFHEADING*)
> >              echo "$(expr "$str" : "DEFHEADING(\(.*\))")"
> >              ;;
> > @@ -49,9 +55,45 @@ hxtotexi()
> >      done
> >  }
> > 
> > +hxtoqmp()
> > +{
> > +    IFS=
> > +    flag=0
> > +    while read -r str; do
> > +        case "$str" in
> > +            HXCOMM*)
> > +            ;;
> > +            SQMP*)
> > +            if test $flag -eq 1 ; then
> > +                echo "line $line: syntax error: expected EQMP, found $str" >&2
> > +                exit 1
> > +            fi
> > +            flag=1
> > +            ;;
> > +            EQMP*)
> > +            if test $flag -ne 1 ; then
> > +                echo "line $line: syntax error: expected SQMP, found $str" >&2
> > +                exit 1
> > +            fi
> > +            flag=0
> > +            ;;
> > +            STEXI*|ETEXI*)
> > +            if test $flag -eq 1 ; then
> > +                echo "line $line: syntax error: expected EQMP, found $str" >&2
> > +                exit 1
> > +            fi
> > +            ;;
> > +            *)
> > +            test $flag -eq 1 && echo "$str"
> > +            ;;
> > +        esac
> > +    done
> > +}
> > +
> >  case "$1" in
> >  "-h") hxtoh ;;
> >  "-t") hxtotexi ;;
> > +"-q") hxtoqmp ;;
> >  *) exit 1 ;;
> >  esac
> > 
> 
> Unfortunately, it looks like you mismerged my hxtool changes (the syntax
> checking bits and the extensions for S/EQMP.

 Isn't the extensions for S/EQMP in the hunk right above us?

 I didn't submit the syntax checking bits on purpose, there's something
failing there and I didn't want to check it now.

 This series seems to work as expected, anyway.

  reply	other threads:[~2010-05-19 13:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19  1:32 [Qemu-devel] [PATCH v3 0/3]: QMP: Commands doc Luiz Capitulino
2010-05-19  1:32 ` [Qemu-devel] [PATCH 1/3] monitor: Reorder info documentation Luiz Capitulino
2010-05-19  1:32 ` [Qemu-devel] [PATCH 2/3] QMP: Introduce commands documentation Luiz Capitulino
2010-05-19  9:15   ` [Qemu-devel] " Jan Kiszka
2010-05-19 13:06     ` Luiz Capitulino [this message]
2010-05-19 13:30       ` Jan Kiszka
2010-05-19 13:46         ` Luiz Capitulino
2010-05-19 13:50           ` Jan Kiszka
2010-05-19 13:55             ` Luiz Capitulino
2010-05-19  1:32 ` [Qemu-devel] [PATCH 3/3] Monitor: Drop QMP documentation from code Luiz Capitulino
2010-05-21  6:37   ` Markus Armbruster
2010-05-29  8:50 ` [Qemu-devel] Re: [PATCH v3 0/3]: QMP: Commands doc Jan Kiszka
2010-05-31 13:52   ` Luiz Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2010-05-31 17:43 [Qemu-devel] [PATCH v4 " Luiz Capitulino
2010-05-31 17:43 ` [Qemu-devel] [PATCH 2/3] QMP: Introduce commands documentation Luiz Capitulino
2010-06-01 16:10   ` [Qemu-devel] " Jan Kiszka
2010-06-01 17:27     ` Luiz Capitulino
2010-06-01 17:39       ` Jan Kiszka
2010-06-01 18:07         ` Anthony Liguori
2010-06-01 18:08           ` Jan Kiszka

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=20100519100629.3009bee7@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.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).